Merge "Fix bug 5183332 - monkeys are jerks"

This commit is contained in:
Adam Powell
2011-08-18 11:30:48 -07:00
committed by Android (Google) Code Review

View File

@@ -386,8 +386,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
// Ditch the menu created above // Ditch the menu created above
st.menu = null; st.menu = null;
// Don't show it in the action bar either if (mActionBar != null) {
mActionBar.setMenu(null, mActionMenuPresenterCallback); // Don't show it in the action bar either
mActionBar.setMenu(null, mActionMenuPresenterCallback);
}
return false; return false;
} }
@@ -409,9 +411,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
} }
if (!cb.onPreparePanel(st.featureId, st.createdPanelView, st.menu)) { if (!cb.onPreparePanel(st.featureId, st.createdPanelView, st.menu)) {
// The app didn't want to show the menu for now but it still exists. if (mActionBar != null) {
// Clear it out of the action bar. // The app didn't want to show the menu for now but it still exists.
mActionBar.setMenu(null, mActionMenuPresenterCallback); // Clear it out of the action bar.
mActionBar.setMenu(null, mActionMenuPresenterCallback);
}
st.menu.startDispatchingItemsChanged(); st.menu.startDispatchingItemsChanged();
return false; return false;
} }