Clean up some options menu/action bar menu handling for Dialogs.
Add Dialog#invalidateOptionsMenu so that dialogs hosting action bars have a way to request a refresh of menu content. Change-Id: I73aa22c2df1c5e60b94035e30af548f87073dbb9
This commit is contained in:
@@ -228,6 +228,9 @@ public class Dialog implements DialogInterface, Window.Callback,
|
||||
public void show() {
|
||||
if (mShowing) {
|
||||
if (mDecor != null) {
|
||||
if (mWindow.hasFeature(Window.FEATURE_ACTION_BAR)) {
|
||||
mWindow.invalidatePanelMenu(Window.FEATURE_ACTION_BAR);
|
||||
}
|
||||
mDecor.setVisibility(View.VISIBLE);
|
||||
}
|
||||
return;
|
||||
@@ -791,6 +794,13 @@ public class Dialog implements DialogInterface, Window.Callback,
|
||||
mWindow.closePanel(Window.FEATURE_OPTIONS_PANEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Activity#invalidateOptionsMenu()
|
||||
*/
|
||||
public void invalidateOptionsMenu() {
|
||||
mWindow.invalidatePanelMenu(Window.FEATURE_OPTIONS_PANEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Activity#onCreateContextMenu(ContextMenu, View, ContextMenuInfo)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user