Java android.view Menu fields, constructors, methods, implement or subclass

Example usage for Java android.view Menu fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.view Menu.

The text is from its open source code.

Implementation

android.view.Menu has the following implementations.
Click this link to see all its implementation.

Field

intNONE
Value to use for group and item identifier integers when you don't care about them.
intFIRST
First value for group and item identifier integers.
intCATEGORY_CONTAINER
Category code for the order integer for items/groups that are part of a container -- or/add this with your base value.
intCATEGORY_SYSTEM
Category code for the order integer for items/groups that are provided by the system -- or/add this with your base value.
intCATEGORY_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.
intCATEGORY_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.
intFLAG_PERFORM_NO_CLOSE
Flag for #performShortcut : if set, do not close the menu after executing the shortcut.
intFLAG_ALWAYS_PERFORM_CLOSE
Flag for #performShortcut(int,KeyEvent,int) : if set, always close the menu after executing the shortcut.

Method

MenuItemadd(int groupId, int itemId, int order, CharSequence title)
Add a new item to the menu.
MenuItemadd(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.
MenuItemadd(CharSequence title)
Add a new item to the menu.
MenuItemadd(@StringRes int titleRes)
Add a new item to the menu.
intaddIntentOptions(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.
SubMenuaddSubMenu(final int groupId, final int itemId, int order, final CharSequence title)
Add a new sub-menu to the menu.
SubMenuaddSubMenu(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.
SubMenuaddSubMenu(final CharSequence title)
Add a new sub-menu to the menu.
SubMenuaddSubMenu(@StringRes final int titleRes)
Add a new sub-menu to the menu.
voidclear()
Remove all existing items from the menu, leaving it empty as if it had just been created.
voidclose()
Closes the menu, if open.
booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
MenuItemfindItem(int id)
Return the menu item with a particular identifier.
ClassgetClass()
Returns the runtime class of this Object .
MenuItemgetItem(int index)
Gets the menu item at the given index.
booleanhasVisibleItems()
Return whether the menu currently has item items that are visible.
booleanperformIdentifierAction(int id, int flags)
Execute the menu item action associated with the given menu identifier.
booleanperformShortcut(int keyCode, KeyEvent event, int flags)
Execute the menu item action associated with the given shortcut character.
voidremoveGroup(int groupId)
Remove all items in the given group.
voidremoveItem(int id)
Remove the item with the given identifier.
voidsetGroupCheckable(int group, boolean checkable, boolean exclusive)
Control whether a particular group of items can show a check mark.
voidsetGroupEnabled(int group, boolean enabled)
Enable or disable all menu items that are in the given group.
voidsetGroupVisible(int group, boolean visible)
Show or hide all menu items that are in the given group.
voidsetQwertyMode(boolean isQwerty)
Control whether the menu should be running in qwerty mode (alphabetic shortcuts) or 12-key mode (numeric shortcuts).
intsize()
Get the number of items in the menu.
StringtoString()
Returns a string representation of the object.