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


/ Published in: XML
Save to your folder(s)



Copy this code and paste it in your HTML
  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"

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.