Example usage for Java android.view Menu fields, constructors, methods, implement or subclass
The text is from its open source code.
int | NONE Value to use for group and item identifier integers when you don't care about them. |
int | FIRST First value for group and item identifier integers. |
int | CATEGORY_CONTAINER Category code for the order integer for items/groups that are part of a container -- or/add this with your base value. |
int | CATEGORY_SYSTEM Category code for the order integer for items/groups that are provided by the system -- or/add this with your base value. |
int | CATEGORY_SECONDARY Category code for the order integer for items/groups that are user-supplied secondary (infrequently used) options -- or/add this with your base value. |
int | CATEGORY_ALTERNATIVE Category code for the order integer for items/groups that are alternative actions on the data that is currently displayed -- or/add this with your base value. |
int | FLAG_PERFORM_NO_CLOSE Flag for #performShortcut : if set, do not close the menu after executing the shortcut. |
int | FLAG_ALWAYS_PERFORM_CLOSE Flag for #performShortcut(int,KeyEvent,int) : if set, always close the menu after executing the shortcut. |
MenuItem | add(int groupId, int itemId, int order, CharSequence title) Add a new item to the menu. |
MenuItem | add(int groupId, int itemId, int order, @StringRes int titleRes) Variation on #add(int,int,int,CharSequence) that takes a string resource identifier instead of the string itself. |
MenuItem | add(CharSequence title) Add a new item to the menu. |
MenuItem | add(@StringRes int titleRes) Add a new item to the menu. |
int | addIntentOptions(int groupId, int itemId, int order, ComponentName caller, Intent[] specifics, Intent intent, int flags, MenuItem[] outSpecificItems) Add a group of menu items corresponding to actions that can be performed for a particular Intent. |
SubMenu | addSubMenu(final int groupId, final int itemId, int order, final CharSequence title) Add a new sub-menu to the menu. |
SubMenu | addSubMenu(int groupId, int itemId, int order, @StringRes int titleRes) Variation on #addSubMenu(int,int,int,CharSequence) that takes a string resource identifier for the title instead of the string itself. |
SubMenu | addSubMenu(final CharSequence title) Add a new sub-menu to the menu. |
SubMenu | addSubMenu(@StringRes final int titleRes) Add a new sub-menu to the menu. |
void | clear() Remove all existing items from the menu, leaving it empty as if it had just been created. |
void | close() Closes the menu, if open. |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
MenuItem | findItem(int id) Return the menu item with a particular identifier. |
Class> | getClass() Returns the runtime class of this Object . |
MenuItem | getItem(int index) Gets the menu item at the given index. |
boolean | hasVisibleItems() Return whether the menu currently has item items that are visible. |
boolean | performIdentifierAction(int id, int flags) Execute the menu item action associated with the given menu identifier. |
boolean | performShortcut(int keyCode, KeyEvent event, int flags) Execute the menu item action associated with the given shortcut character. |
void | removeGroup(int groupId) Remove all items in the given group. |
void | removeItem(int id) Remove the item with the given identifier. |
void | setGroupCheckable(int group, boolean checkable, boolean exclusive) Control whether a particular group of items can show a check mark. |
void | setGroupEnabled(int group, boolean enabled) Enable or disable all menu items that are in the given group. |
void | setGroupVisible(int group, boolean visible) Show or hide all menu items that are in the given group. |
void | setQwertyMode(boolean isQwerty) Control whether the menu should be running in qwerty mode (alphabetic shortcuts) or 12-key mode (numeric shortcuts). |
int | size() Get the number of items in the menu. |
String | toString() Returns a string representation of the object. |