This question is asked multiple times and it has answers that used to work. Recently in documentation said, they have removed this feature for security reasons. Only some limited things can be restored for the webView state. I have tried multiple ways to do it but every time it refreshes the webView state and it doesn't show the webView content.
What I want to do?
I have a web app that I want to retrieve the user content after time-out (If they input their credentials correct).
What I have done so far?
1- I have tried all solutions including the following approaches:
@Override
protected void onSaveInstanceState(Bundle outState) {
webView.saveState(outState);
}
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.blah);
WebView webview = (WebView)findViewById(R.id.webview);
if (savedInstanceState != null)
webview.restoreState(savedInstanceState);
else
webview.loadUrl(URLData)
}
Also manifest file
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|uiMode|screenSize|smallestScreenSize"
2- I tried to show my Time-Out activity as a dialog and it worked if I just dismiss it without evaluating the credentials but if I evaluate and dismiss the dialog it recreates the webView.
Any help would be appreciated.