title: Android: show a progress dialog then dismiss properly
body: <p>I've found that a lot of people are having a similar problem but I am simply trying to show a  dialog while I am grabbing some data off a URL and then dismiss properly after the data is  retrieved. Here is what I'm trying to do (This is in my onClick() method for a refresh button):</p>
  
  <pre><code>dialog.show();  
  // do some work  
  dialog.dismiss();
  </code></pre>
  
  <p>Doing it this way you never really see the dialog at all. I've tried doing it using an  extra thread such as:  </p>
  
  <pre><code>Thread t = new Thread() {
      public void run() {
          dialog.show();
      }
  };
  </code></pre>
  
  <p>But this way I get an error and a force close down...<br>
  <strong>What is the best method to do this?</strong></p>