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

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

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

unit testing - How to mock PreferenceManager in Android? -