title: onPreExecute as preloader for webview in a fragment
body: <p>I am trying to show a preloader before loading the complete page as webview but here is a small problem which I already made a preloader but it goes on and on and there is no end to it .</p>
  
  <p>How can I tell the script to stop showing dialog when the page is loaded .</p>
  
  <pre><code>    public class EzFragment extends Fragment {
  
          public ProgressDialog pDialog;
  
  
          public EzFragment(){}
  
          public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              new getFeed().execute();
  
          }
          @Override
          public View onCreateView(LayoutInflater inflater, ViewGroup container,
                  Bundle savedInstanceState) {
  
              View rootView = inflater.inflate(R.layout.fragment_ez, container, false);
              WebView myWebView = (WebView) rootView.findViewById(R.id.webView1);
  
               String summary = "&lt;html&gt;&lt;head&gt; &lt;link rel=\"stylesheet\" type=\"text/css\" 
  href=\"http://www.example.com/demo/android_connect/assets/style/jquery.fullPage.css\" /&gt;&lt;/head&gt;&lt;/html&gt;";
               myWebView.loadData(summary, "text/html", null);
  
  
              myWebView.loadUrl("http://www.example.com/demo/android_connect/get_ez_webmob.php");
              WebSettings webSettings = myWebView.getSettings();
              webSettings.setJavaScriptEnabled(true);
  
  
  
              return rootView;
          }
  
  
      private class getFeed extends AsyncTask&lt;Void, Void, Document&gt; {
        @Override
          protected void onPreExecute() {
              super.onPreExecute();
              pDialog = new ProgressDialog(getActivity());
              pDialog.setTitle("Connect to Server");
              pDialog.setMessage("This process can take a few seconds to a few minutes, depending on your Internet Connection Speed.");
              pDialog.setIndeterminate(false);
              pDialog.setCancelable(false);
              pDialog.show();
          }
  
      @Override
      protected Document doInBackground(Void... arg0) {
          // TODO Auto-generated method stub
          return null;
      }
  
      }
  </code></pre>
  
  <p><strong>Is it possible to add webview to Document doInBackground in order to load the page in background ?!</strong></p>