title: Android Indeterminate ProgressBar does not spin
body: <p>Sorry if this has been asked before but I cannot find the answer for this (I have searched!)</p>
  
  <p>I have tried to follow the google/android documentation to make an indeterminate progressbar appear and spin while my app does a lengthy task.</p>
  
  <pre><code>protected void readData(final String whatToFind) 
  {
  
      try
      {
          if (whatToFind.length() == 0)
          {
              adapter.notifyDataSetChanged();
              return;
          }
  
  
          mProgress.setVisibility(View.VISIBLE);
          mProgressText.setVisibility(View.VISIBLE);
  
          m_dialog = new ProgressDialog(this);
              m_dialog.setTitle("Searching...");
              m_dialog.setMessage("Please wait while searching...");
              m_dialog.setIndeterminate(true);
              m_dialog.setCancelable(true); 
              m_dialog.show(); 
  
          new Thread(new Runnable() 
          {
              public void run() 
              {
                  mHandler.post(new Runnable() 
                  {    
                      public void run() 
                      {
  
                                  while (LotsOfWorkGoingOn)  
                                  {
                                      // Update the progress bar
                                          mHandler.post(new Runnable() {
                                           public void run() {
                                               mProgress.setProgress(m_i); /// vain attempt to make the progressbar spin
                                           }
                                       });                                
  
                                                           mProgress.setVisibility(View.GONE);
                                                           mProgressText.setVisibility(View.GONE);
                                                           m_dialog.hide();
  
                                              }
  
                          });
              }
          }).start();
  
      }
      catch (Exception ex)
      {
          Log.e(LOGid, "Error listing items:" + ex.getStackTrace());
      }
  </code></pre>