When I rotate my screen, the WebView reloads the whole page. So I disabled rotation in Android_Manifest.xml file, but it would be really cool if I could make rotation possib
All you need to do is Override onSaveInstanceState
and onRestoreInstanceState
.
@Override
protected void onSaveInstanceState(Bundle outState ){
super.onSaveInstanceState(outState);
mWebView.saveState(outState);
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState){
super.onRestoreInstanceState(savedInstanceState);
mWebView.restoreState(savedInstanceState);
}
and one other solution could be to update your Activity tag in manifest to
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"