title: Android UI Freezes instead of displaying ProgressDialog
body: <p>I am trying to display a progress dialog during downloading of data. </p>
  
  <p>Right now, this is what I have:</p>
  
  <pre><code>    final ProgressDialog pd = ProgressDialog.show(this, "Updating", "Loading...");
      Thread td = new Thread(new Runnable(){
          public void run(){
             //time consuming download
             pd.dismiss();
          }
       });
       td.start(); // start the thread and use join to wait for it to return
  
       td.join(); //wrapped in try catch not shown here
  </code></pre>
  
  <p>I don't need progress updates from the download, and the app shouldn't do anything else until the data is downloaded, that's why I use join - so it'll wait for the download to finish.</p>
  
  <p>The result I'm getting is</p>
  
  <ol>
  <li>Push button</li>
  <li>UI freezes</li>
  <li>progress dialog flashes on and off, download is done</li>
  </ol>
  
  <p>what I need is</p>
  
  <ol>
  <li>Push button</li>
  <li>progress dialog shows</li>
  <li>progress dialog turns off, download is done.</li>
  </ol>
  
  <p>Any idea why it's not showing right away, and instead flashing on and off when it is done?</p>