title: Android Asynctask on PreExecute method not called
body: <p>I want to start a <code>ProgressDialog</code> when <code>onPreExecute()</code> is called but it is not working.</p>
  
  <p><strong>Homeactivity.java</strong></p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      //switch condtion...
      case R.id.buttontime :                
          new FlightListTask().execute("");
          break:  
  
  }
  
  public class FlightListTask extends AsyncTask&lt;String,ArrayList&lt;HashMap&lt;String, String&gt;&gt;, ArrayList&lt;HashMap&lt;String, String&gt;&gt;&gt; {
  
      protected String onPreExecute(String temp) {
          progresdialoglistview=ProgressDialog.show(HomeActivity.this, "", "Loading");
          Log.e("onPreExecutive","called"+progresdialoglistview);
          return temp;
      }
  
      @Override
      protected ArrayList&lt;HashMap&lt;String, String&gt;&gt; doInBackground( String... params ) {
          return flightlist;
      }
  
      protected void onPostExecute(ArrayList&lt;HashMap&lt;String, String&gt;&gt; flightList) {
          // listview code....
      }
  
  }
  </code></pre>