Posted By

phantomas on 11/07/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dotNetkow


Prevent views from being invalidated when device rotates (=orientation changes)


 / Published in: XML
 

URL: http://stackoverflow.com/questions/1002085/android-webview-handling-orientation-changes/2246555#2246555

  1. If you do not want views to reload on orientation changes simply override onConfigurationChanged in your Activity class:
  2.  
  3. @Override
  4. public void onConfigurationChanged(Configuration newConfig){
  5. super.onConfigurationChanged(newConfig);
  6. }
  7.  
  8. And set the android:configChanges attribute in the manifest:
  9.  
  10. <activity android:name="..."
  11. android:label="@string/appName"
  12. android:configChanges="orientation"

Report this snippet  

You need to login to post a comment.