title: Android using Multiple Progress Dialogs
body: <p>I am trying to build a class to go to the web, download data and then load it into a database.  I have no problem doing this with a single progress dialog but can simply not figure out how to have multiple dialogs.  In researching this, I found hundreds of Progress Dialog questions, so it does not seem as straight forward as it should be.</p>
  
  <p>I have tried using handlers and threads but simply cannot ma</p>
  
  <p>I am looking for an example of working code to accomplish this.</p>
  
  <p>Here is the pseudo code that I am attempting:</p>
  
  <pre><code>public class myactivity extends Activity()
  {
      private WebIO webIO   ;     // web acess io
      private DataIO DataIO ;     // database  io
  
      public void onCreate( Bundle savedInstanceState ) {
          DataIO = new DataIO( this );
          WebIO  = new WebIO();
          DataIO.open();
          runProgram();
      }
  }
  
  private void runProgram() {
      startProgressDialog( "Downloading data from web" );
  
      new Thread() {
          public void run() {
              try{
                  String vData = webIO.getData();
  
                  dismissProgressDialog();
  
                  if  ( vData.length() &gt; 0 ) {
                      promptUser( vData );
      } } } }
  }
  
  private void promptUser( vData ){
      if alertdialog_to_prompt_user_to_load(){
      {
          loadData( pData )
      }
  
  private void loadData( String pData ){
      startProgressDialog( "Loading data into database" );
  
      new Thread() {
          public void run() {
              try{
                  loadDataIntoDatabase();
  
                  dismissProgressDialog();
      } } } }
  }
  </code></pre>