title: Android WebView with ProgressDialog. How do I kill it?
body: <p>I've tried everything I know how to do to kill it. What I want it to do is load the webpage and then kill the ProgressDialog. How do?</p>
  
  <pre><code>package com.calebfultz.package;
  
  import android.app.Activity;
  import android.app.ProgressDialog;
  import android.os.Bundle;
  import android.view.KeyEvent;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.view.View.OnKeyListener;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  import android.widget.Button;
  import android.widget.EditText;
  
  public class Lists extends Activity {
      private WebView webView;
  
  
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.web);
          ProgressDialog pd = ProgressDialog.show(Lists.this, "", 
                  "Loading. Please wait...", true);
          // Create reference to UI elements
          webView  = (WebView) findViewById(R.id.web_engine);
          webView.getSettings().setJavaScriptEnabled(true);
          webView.loadUrl("http://cfultz.tumblr.com");
  
  
          // workaround so that the default browser doesn't take over
          webView.setWebViewClient(new MyWebViewClient()
  
          );
  
      }
  
  
      private class MyWebViewClient extends WebViewClient {
          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
              view.loadUrl(url);
              return true;
          }
      }    
  }
  </code></pre>