Merge "DO NOT MERGE Cherry pick from ics-mr1 - Bug 5275928 - Don't try to open an overflow menu under invalid circumstances." into ics-mr0
This commit is contained in:
@@ -300,6 +300,7 @@ public class ActionMenuPresenter extends BaseMenuPresenter
|
|||||||
public boolean hideOverflowMenu() {
|
public boolean hideOverflowMenu() {
|
||||||
if (mPostedOpenRunnable != null && mMenuView != null) {
|
if (mPostedOpenRunnable != null && mMenuView != null) {
|
||||||
((View) mMenuView).removeCallbacks(mPostedOpenRunnable);
|
((View) mMenuView).removeCallbacks(mPostedOpenRunnable);
|
||||||
|
mPostedOpenRunnable = null;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -653,10 +654,11 @@ public class ActionMenuPresenter extends BaseMenuPresenter
|
|||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
mMenu.changeMenuMode();
|
mMenu.changeMenuMode();
|
||||||
if (mPopup.tryShow()) {
|
final View menuView = (View) mMenuView;
|
||||||
|
if (menuView != null && menuView.getWindowToken() != null && mPopup.tryShow()) {
|
||||||
mOverflowPopup = mPopup;
|
mOverflowPopup = mPopup;
|
||||||
mPostedOpenRunnable = null;
|
|
||||||
}
|
}
|
||||||
|
mPostedOpenRunnable = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,6 +216,9 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi
|
|||||||
});
|
});
|
||||||
|
|
||||||
final MenuBuilder menu = (MenuBuilder) mode.getMenu();
|
final MenuBuilder menu = (MenuBuilder) mode.getMenu();
|
||||||
|
if (mActionMenuPresenter != null) {
|
||||||
|
mActionMenuPresenter.dismissPopupMenus();
|
||||||
|
}
|
||||||
mActionMenuPresenter = new ActionMenuPresenter(mContext);
|
mActionMenuPresenter = new ActionMenuPresenter(mContext);
|
||||||
mActionMenuPresenter.setReserveOverflow(true);
|
mActionMenuPresenter.setReserveOverflow(true);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user