title: Why my progress dialog is not spinning while new intent start()?
body: <p>I try to open the 2nd activity which require some time to load data from internet first from main activity, during this period, my screen will full in black, so i decide to use progress dialog to show "hey, I'M STILL alive, DON'T CLOSE ME!"
  Everything went perfectly but the only problem is that the spinner is not rotating. here is my code:
  after button is click: new YourAsyncTask().execute();</p>
  
  <pre><code>public class YourAsyncTask extends AsyncTask&lt;Void, Void, Void&gt; {
  
      private ProgressDialog myDialog;
  
      @Override
      protected void onPreExecute() {
          //show your dialog here
          myDialog = ProgressDialog.show(ScrollingTab.this, "loading..", "please wait..", true, true);  
          myDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 
      }
  
      @Override
      protected Void doInBackground(Void... params) {        
          //update your DB - it will run in a different thread
  
          startActivity(new Intent("com.android.ricky.RESULT_DETAIL"));
          return null;
      }
  
      @Override
      protected void onPostExecute(Void result) {
          //hide your dialog here
          myDialog.dismiss();
      }
  }
  </code></pre>
  
  <p>I have tried to remove " startActivity(new Intent("com.android.ricky.RESULT_DETAIL"));" and "myDialog.dismiss();" at the same time, then the spinner is rotating >&lt;
  please help, thanks a lot!</p>