code: public boolean dismissPopup() {
          if (isShowingPopup()) {
              getListPopupWindow().dismiss();
              ViewTreeObserver viewTreeObserver = getViewTreeObserver();
              if (viewTreeObserver.isAlive()) {
                  viewTreeObserver.removeGlobalOnLayoutListener(mOnGlobalLayoutListener);
              }
          }
          return true;
      }
docs: Dismisses the popup window with activities.
  
  @return True if dismissed, false if already dismissed.