title: Show ProgressDialog in onPreExecute but it appear and dismiss in onPostExecute at the same time
body: <p>I want to show a ProgressDialog when running a time consuming method using a private class which extends AsyncTask in an activity class. But the ProgressDialog  which is supposed to be appear in onPreExecute doesn't show up when onPreExecute. Instead of it, the ProgressDialog shows up and dismiss immediately after the time consuming method is done.</p>
  
  <pre><code>            public class ABC extends Activity {
  
              /*somewhere in ABC
                  load = new Load();
                  load.execute(a,b,c);
                  int action = load.get();*/
  
              private class Load extends AsyncTask&lt;Object, Integer, Integer&gt;{ 
  
                      private ProgressDialog progDailog;
  
                      @Override
                      protected Integer doInBackground(Object... param) {
                          Log.v("!!!!!!Load!!!!!!!!!","doInBackground");
                          Object a = (Object) param[0];
                          int b = (Integer) param[1];
                          int c = (Integer) param[2];
                          return a.doSomething(b, c);
                      }
  
                      @Override
                      protected void onPostExecute(Integer result) {
                          super.onPostExecute(result);            
                          progDailog.dismiss();
                          Log.v("!!!!!!Load!!!!!!!!!","onPostExecute");
                      }
  
                      @Override
                      protected void onPreExecute() {
                          super.onPreExecute();
                          Log.v("!!!!!!Load!!!!!!!!!","onPreExecute");
                          progDailog = new ProgressDialog(ABC.this); 
                          progDailog.setMessage("Loading..."); 
                          progDailog.show();
                      }
  
  
                  }
  
              }
  </code></pre>
  
  <p>Below is the logcat:</p>
  
  <pre><code>05-03 00:38:49.202: V/!!!!!!Load!!!!!!!!!(14666): preExecute
  05-03 00:38:49.202: D/ProgressBar(14666): setProgress = 0
  05-03 00:38:49.202: D/ProgressBar(14666): setProgress = 0, fromUser = false
  05-03 00:38:49.202: D/ProgressBar(14666): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 10000
  05-03 00:38:49.232: V/!!!!!!Load!!!!!!!!!(14666): doInBackground
  05-03 00:38:53.662: I/Choreographer(14666): Skipped 269 frames!  The application may be doing too much work on its main thread.
  05-03 00:38:53.762: D/ProgressBar(14666): updateDrawableBounds: left = 0
  05-03 00:38:53.762: D/ProgressBar(14666): updateDrawableBounds: top = 0
  05-03 00:38:53.762: D/ProgressBar(14666): updateDrawableBounds: right = 144
  05-03 00:38:53.762: D/ProgressBar(14666): updateDrawableBounds: bottom = 144
  05-03 00:38:53.772: V/!!!!!!Load!!!!!!!!!(14666): onPostExecute
  </code></pre>