I made a android app, weatherin[@installify.com] which have fullsize width-height web view, but whenever i change from portrait to landscape or vice-versa in android mobile , the webview reload the page, how i can prevent it from reloading again & again.. my apps for all[basic] android version , from 2.2 to top. thanx in advance
Asked
Active
Viewed 2,124 times
2 Answers
0
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
}

zapdroid
- 562
- 5
- 16
-
There is no `setRetainInstance` method – AlexioVay Mar 21 '17 at 17:41
0
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...
...
...
if (savedInstanceState != null) {
mWebView.restoreState(savedInstanceState);
} else {
mWebView.loadUrl();
}
}

Rahul
- 381
- 1
- 5
- 19