title: How to save WebView state and restore it in Android Lollipop?
body: <p>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.</p>
  
  <p><strong>What I want to do?</strong></p>
  
  <p>I have a web app that I want to retrieve the user content after time-out (If they input their credentials correct).</p>
  
  <pre></pre>
  
  <p><strong>What I have done so far?</strong></p>
  
  <p>1- I have tried all solutions including the following approaches:</p>
  
  <pre><code>@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)
  }
  </code></pre>
  
  <p>Also manifest file</p>
  
  <pre><code>android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|uiMode|screenSize|smallestScreenSize"
  </code></pre>
  
  <p>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.</p>
  
  <p>Any help would be appreciated.</p>