Android, how to not destroy the activity when I rotate the device? -


i have app works in portrait mode, , have made changes in manifest file every activity orientation portrait. when rotate device, activity recreates again. how not destroy activity?

for api 12 , below: add

android:configchanges="orientation" 

add "screensize" if targeting api 13 or above because whenever orientation changes screen size, otherwise new devices continue destroy activity. see egg's answer below more information on using "screensize"

android:configchanges="orientation|screensize" 

to activity in androidmanifest.xml. way activity wont restarted automatically. see the documentation more infos


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -