title: Save state WebView in Fragment
body: <p>I'd like to have webview which saves state in Fragment. What I want. I want to save state on my webview in fragment when I switch the Fragment by Navigation Drawer. I found some code to save the state, but actually I don't know where to write it. Can someone help me with that, please? I am sorry for my English.</p>
  <p>Here is code for savestate</p>
  <pre><code>@Override
  public void onSaveInstanceState(Bundle outState) {
     super.onSaveInstanceState(outState);
     mWebView.saveState(outState);
  }
  
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
     super.onActivityCreated(savedInstanceState);
     mWebView.restoreState(savedInstanceState);
  }
  </code></pre>
  <p><strong>This is my code</strong></p>
  <pre><code>public class Zastupovanie extends SherlockFragment{
  
      private Context context;
          
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup group, Bundle saved){
  
          View v = inflater.inflate(R.layout.zastupovanie, group, false);
          final ProgressDialog pd = ProgressDialog.show(getActivity(),  &quot;&quot;, &quot;Prosím čakajte. Prebieha načítavanie... &quot;, true);
      
          final WebView myWebView = (WebView) v.findViewById(R.id.zastupovanie2);
          myWebView.setWebViewClient(new WebViewClient() {
              @Override
              public void onPageFinished(WebView view, String url) {
                  pd.dismiss();
              }
          });
      
          myWebView.getSettings().setBuiltInZoomControls(false); 
          myWebView.getSettings().setSupportZoom(false);
          myWebView.getSettings()
             .setJavaScriptCanOpenWindowsAutomatically(true);   
          myWebView.getSettings().setJavaScriptEnabled(true);
          myWebView.getSettings().setAllowFileAccess(true); 
          myWebView.getSettings().setDomStorageEnabled(true);
          myWebView.getSettings().setDefaultZoom(ZoomDensity.FAR);      
          myWebView
              .loadUrl(&quot;http://soszm.edupage.org/substitution/?&quot;);
      
          return v;
      }
          
  }
  </code></pre>