title: How do I show and then remove an android progress dialog
body: <p>I can get a progress bar to appear with the following code</p>
  
  <pre><code>pd = ProgressDialog.show(myActivity.this, "", "Loading. Please wait...", true);
  </code></pre>
  
  <p>straight forward, but once I have the code execute I want it to go away, but when I run the dismiss method after I never see the dialog box show at all.</p>
  
  <p>Heres the code in context which is wrapped in oncreate</p>
  
  <pre><code>pd = ProgressDialog.show(myActivity.this, "", "Loading. Please wait...", true);
  runCode();  
  setListAdapter(new CustomAdapter(myActivity.this)); 
  pd.dismiss();
  </code></pre>
  
  <p>I thought you can show/dismiss progress dialog's anywhere in the activity but I must be wrong.</p>