diff options
author | Adam Powell <adamp@google.com> | 2011-10-31 12:26:08 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-10-31 12:26:08 +0000 |
commit | aa7cbf90ca53046bd923949bae99e199b8f284fe (patch) | |
tree | 9ea06d0574039f7e20763269a3d03a948dc201e9 | |
parent | ddcc3a53d18d030e3cdfcff5b2b8c80c219e25a8 (diff) | |
parent | 678ed0c5a32bac1ea18a5ac99b0b814421ea79b4 (diff) | |
download | frameworks_base-aa7cbf90ca53046bd923949bae99e199b8f284fe.zip frameworks_base-aa7cbf90ca53046bd923949bae99e199b8f284fe.tar.gz frameworks_base-aa7cbf90ca53046bd923949bae99e199b8f284fe.tar.bz2 |
am 678ed0c5: Bug 5275928 - Don\'t try to open an overflow menu under invalid circumstances.
* commit '678ed0c5a32bac1ea18a5ac99b0b814421ea79b4':
Bug 5275928 - Don't try to open an overflow menu under invalid circumstances.
-rw-r--r-- | core/java/com/android/internal/view/menu/ActionMenuPresenter.java | 6 | ||||
-rw-r--r-- | core/java/com/android/internal/widget/ActionBarContextView.java | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/core/java/com/android/internal/view/menu/ActionMenuPresenter.java b/core/java/com/android/internal/view/menu/ActionMenuPresenter.java index f25d65f..530809b 100644 --- a/core/java/com/android/internal/view/menu/ActionMenuPresenter.java +++ b/core/java/com/android/internal/view/menu/ActionMenuPresenter.java @@ -300,6 +300,7 @@ public class ActionMenuPresenter extends BaseMenuPresenter public boolean hideOverflowMenu() { if (mPostedOpenRunnable != null && mMenuView != null) { ((View) mMenuView).removeCallbacks(mPostedOpenRunnable); + mPostedOpenRunnable = null; return true; } @@ -653,10 +654,11 @@ public class ActionMenuPresenter extends BaseMenuPresenter public void run() { mMenu.changeMenuMode(); - if (mPopup.tryShow()) { + final View menuView = (View) mMenuView; + if (menuView != null && menuView.getWindowToken() != null && mPopup.tryShow()) { mOverflowPopup = mPopup; - mPostedOpenRunnable = null; } + mPostedOpenRunnable = null; } } } diff --git a/core/java/com/android/internal/widget/ActionBarContextView.java b/core/java/com/android/internal/widget/ActionBarContextView.java index 18d45f7..ed02636 100644 --- a/core/java/com/android/internal/widget/ActionBarContextView.java +++ b/core/java/com/android/internal/widget/ActionBarContextView.java @@ -216,6 +216,9 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi }); final MenuBuilder menu = (MenuBuilder) mode.getMenu(); + if (mActionMenuPresenter != null) { + mActionMenuPresenter.dismissPopupMenus(); + } mActionMenuPresenter = new ActionMenuPresenter(mContext); mActionMenuPresenter.setReserveOverflow(true); |