Android WebView: handling orientation changes


The issue is the performance following rotation. The WebView has to reload the page, which can be a bit tedious.

What's the best way of handling an orientation change without reloading the page from source each time?

Best Solution

If you do not want the WebView to reload on orientation changes simply override onConfigurationChanged in your Activity class:

public void onConfigurationChanged(Configuration newConfig){        

And set the android:configChanges attribute in the manifest:

<activity android:name="..."

for more info see: