File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
core/java/com/android/internal Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -300,6 +300,7 @@ public boolean showOverflowMenu() {
300300 public boolean hideOverflowMenu () {
301301 if (mPostedOpenRunnable != null && mMenuView != null ) {
302302 ((View ) mMenuView ).removeCallbacks (mPostedOpenRunnable );
303+ mPostedOpenRunnable = null ;
303304 return true ;
304305 }
305306
@@ -653,10 +654,11 @@ public OpenOverflowRunnable(OverflowPopup popup) {
653654
654655 public void run () {
655656 mMenu .changeMenuMode ();
656- if (mPopup .tryShow ()) {
657+ final View menuView = (View ) mMenuView ;
658+ if (menuView != null && menuView .getWindowToken () != null && mPopup .tryShow ()) {
657659 mOverflowPopup = mPopup ;
658- mPostedOpenRunnable = null ;
659660 }
661+ mPostedOpenRunnable = null ;
660662 }
661663 }
662664}
Original file line number Diff line number Diff line change @@ -216,6 +216,9 @@ public void onClick(View v) {
216216 });
217217
218218 final MenuBuilder menu = (MenuBuilder ) mode .getMenu ();
219+ if (mActionMenuPresenter != null ) {
220+ mActionMenuPresenter .dismissPopupMenus ();
221+ }
219222 mActionMenuPresenter = new ActionMenuPresenter (mContext );
220223 mActionMenuPresenter .setReserveOverflow (true );
221224
You can’t perform that action at this time.
0 commit comments