Retain webview history when viewing Safety notices. Fixes #2160518
Save and restore webview history when changing orientation.
This commit is contained in:
@@ -58,7 +58,11 @@ public class SettingsSafetyLegalActivity extends AlertActivity
|
||||
|
||||
// Begin accessing
|
||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
if (savedInstanceState == null) {
|
||||
mWebView.loadUrl(userSafetylegalUrl);
|
||||
} else {
|
||||
mWebView.restoreState(savedInstanceState);
|
||||
}
|
||||
mWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
@@ -110,4 +114,10 @@ public class SettingsSafetyLegalActivity extends AlertActivity
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle icicle) {
|
||||
mWebView.saveState(icicle);
|
||||
super.onSaveInstanceState(icicle);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user