示例#1
0
  private void dismissDialog() {
    if (mDecor == null || !mShowing) {
      return;
    }
    ViewRoot.mDialogCount -= 1;
    try {
      mWindowManager.removeView(mDecor);
    } finally {
      mDecor = null;
      mWindow.closeAllPanels();
      onStop();
      mShowing = false;

      sendDismissMessage();
    }
  }
示例#2
0
  void dismissDialog() {
    if (mDecor == null || !mShowing) {
      return;
    }

    if (mWindow.isDestroyed()) {
      Log.e(TAG, "Tried to dismissDialog() but the Dialog's window was already destroyed!");
      return;
    }

    try {
      mWindowManager.removeViewImmediate(mDecor);
    } finally {
      if (mActionMode != null) {
        mActionMode.finish();
      }
      mDecor = null;
      mWindow.closeAllPanels();
      onStop();
      mShowing = false;
      Log.d(TAG, "dismissDialog");
      sendDismissMessage();
    }
  }