title: Android: Progress Dialog in AsyncTask not showing up
body: <p>I am starting the <code>asynctask</code> inside a <code>SherlockListFragment</code> which was created inside a <code>SherlockFragmentActivity</code> as a tab. </p>
  
  <p>I pass the <code>asynctask</code> constructor my activity context and initialize the asynctask like this inside <code>onCreate()</code>:</p>
  
  <pre><code>AsyncTask&lt;String, Integer, String[]&gt; asynctask = new DownloadFilesTask(getSherlockActivity()).execute(url);
  </code></pre>
  
  <p>The constructor inside the AsyncTask class DownloadFilesTask looks like this:</p>
  
  <pre><code>private ProgressDialog dialog;
  private SherlockFragmentActivity activity;
  
  public DownloadFilesTask(SherlockFragmentActivity activity) {
          this.activity = activity;
          this.dialog = new ProgressDialog(activity);
      }
  </code></pre>
  
  <p>Pre-execute and post execute look like this:</p>
  
  <pre><code>protected void onPreExecute(){  
          Log.d("AsyncTask!", "Showing dialog now!"); //shown in logcat
          dialog.setMessage("Retrieving all currently airing anime. Please wait.");
          dialog.setCancelable(false);
          dialog.show();  
      }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>protected void onPostExecute(String[] result) { 
      Log.d("AsyncTask!", "Dismissing dialog now!"); //shown in logcat
      dialog.dismiss();
  }
  </code></pre>
  
  <p>But the progress dialog doesn't show up while all the background work is being done! 
  What am I doing wrong here? I think it might be a context problem. </p>