title: Dialog does not show via AsyncTask
body: <p>I have a custom progress dialog that seems to work everywhere except here in my code:</p>
  
  <p>My login activity (relevant snippets):</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
  
      try {
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_login);
          context = this;
          pd = AUtils.getProgressDialog(context, false);
  
  
                  UserExistsAuthenticateAndRoute = getIntent().getBooleanExtra("UserExistsAuthenticateAndRoute", false);
          RouteToActivity = getIntent().getStringExtra("RouteToActivity");
  
          //make sure there is no token in APrefs in memory during login
          APrefs pref = new APrefs();
          if (pref != null) {
              pref.putNMToken(null);
              pref.putNMRefreshToken(null);
          }
  
  
          ClickableSpan span = new ClickableSpan() {
  
              @Override
              public void onClick(View widget) {
  
              }
          };
  
          setActionBar();
          initUi();
          mToolbarTitle.setText("Log In");
      } catch (Exception exc) {
          exc.printStackTrace();
      }
  
  }
          @Override
          protected Void doInBackground(Void... voids) {
  
  
              GDDataManager.get().login(GDUser, new DataCallBack() {
                          @Override
                          public void update(DataUpdate update) {
  
                              if (update.code == 0) {
                                  final GDUser _gdUser = pref.getMember();
                                  //call get status
                                  if (_gdUser != null) {
                                      Log.i(TAG, "getUserStatus()");
                                      GDDataManager.get().getUserStatus(_gdUser, new DataCallBack() {
                                          @Override
                                          public void update(DataUpdate update) {
  
                                              if (update.code == 0) {
                                                  setGdUserStatus((GDUserStatus) update.data);
                                                  loginController(getGdUserStatus(), _gdUser);
  
                                              } else {
  
                                                  Log.e(TAG, "getUserStatus(), error response msg " + update.message);
                                                  if (update.message.contains("error")) {
                                                      App.toast(getString(R.string.general_server_error_message));
  
                                                  }
  
  
                                              }
                                          }
                                      });
                                  }
  
                              } else {
  
                                  Log.e(TAG, "update message:" + update.message);
                                  if (update.message.contains("error")) {
                                      App.toast(getString(R.string.general_server_error_message));
                                  } else if (update.message.contains("could not verify password")) {
                                      App.toast(getString(R.string.could_not_verify_password));
                                  } else if (update.message.contains("no user found")) {
                                      App.toast(getString(R.string.no_user_found));
                                  } else {
                                      App.toast(update.message);
                                  }
  
                                  if (btnLogIn != null) {
                                      //disable is valid in order to prevent double click
                                      btnLogIn.setEnabled(false);
                                      btnLogIn.setTextColor(ContextCompat.getColor(context, R.color.colorGrey));
                                  }
  
                                  edtEmail.setCompoundDrawablesWithIntrinsicBounds(null, null, ContextCompat.getDrawable(context, R.drawable.cross_icon), null);
                                  edtEmail.setBackground(ContextCompat.getDrawable(context, R.drawable.textfield_red));
                                  edtPassword.setBackground(ContextCompat.getDrawable(context, R.drawable.textfield_red));
                              }
  
                          }//end update getUserStatus
                      }
  
              );
  
              return null;
          }
      };
  
      try {
          tryLoginTask.execute();
      } catch (Exception exc) {
          Log.d(TAG, exc.getMessage());
          exc.printStackTrace();
          //cancel task on exception , DISMISS DIALOG to avoid locking screen 
          tryLoginTask.cancel(true);
      }
  
  
  }//end tryLogin()
  </code></pre>
  
  <p>The static code from utility class, were the dialog is returned (relevant snippet):</p>
  
  <pre><code>public static Dialog getProgressDialog(Context c, boolean isCancelable) {
  
      Dialog pd = new Dialog(c,c.getApplicationInfo().theme);
      pd.setCanceledOnTouchOutside(isCancelable);
      pd.requestWindowFeature (Window.FEATURE_NO_TITLE);
      pd.setContentView (R.layout.progress_dialog);
      pd.getWindow().setBackgroundDrawable(new ColorDrawable(Color.argb(150,0,0,0)));
  
      return pd;
  }
  </code></pre>
  
  <p>Im not seeing any errors, exceptions, and the dialog is showiong in other places using the same approach. Sometimes I see it for fraction of a second however the task hasn't completed. </p>
  
  <p>Any suggestions. </p>
  
  <p>Thanks</p>