title: android progressdialog not appearing
body: <p>I'm posting this question because I can't really figure out what is causing, sometimes, a ProgressDialog not appearing. I've looked for all similar questions but none was helpfull form me
  I have this method in a helper class</p>
  
  <pre><code>private static ProgressDialog progressDialog;
  public static void ShowProgressDialog(Context context, String title, String message, boolean cancellable) {
      try {
          if (progressDialog == null)
              progressDialog = ProgressDialog.show(context, title, message);
          else
              LogHelper.WriteLogInfo("ALERT_DIALOG", "progress dialog already exists");
      } catch (Exception e) {
          LogHelper.WriteLogError("error showing progress dialog", e);
      }
  }
  </code></pre>
  
  <p>and I call it from my activity in this way</p>
  
  <pre><code>DialogHelper.ShowProgressDialog(this, "title","progress bar  text",false);
  new MyAsyncTask().execute("inputString");
  </code></pre>
  
  <p>everything works very well, but sometimes the ProgressDialog do not appears, and there are not error logs that should have been written by the LogHelper.WriteLogError in the catch block.</p>
  
  <p>Does anyone have an idea of what is causing this behavior?</p>