title: Android ProgressDialog stops spinning
body: <p>I have created a ProgressDialog in my android application.  But the problem I am having is during the point where it is actually doing the work it stops spinning the wheel.  Here is my code. How can I make it so it continually spins the wheel while my other work is going on? </p>
  
  <pre><code>button5.setOnClickListener(new View.OnClickListener()
  {
  public void onClick(View v)
  {
      System.out.println("Button5");
  
      //Handler to make the please wait message
      final ProgressDialog myProgressDialog = ProgressDialog.show(
              FoodSubstitutesActivity.this, "Please wait...",
              "Getting most recent updates...", true);
      Handler handler = new Handler();
      handler.postDelayed(new Runnable()
      {
          @Override
          public void run()
          {
              //DO STUFF - STOPS SPINNING WHEEL UNTIL THIS PART IS COMPLETE. 
              myProgressDialog.dismiss();
          }
  
      }, 500);
  }
  }); 
  </code></pre>