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

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

Introduction

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

The text is from its open source code.

Implementation

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

Field

intSHOW_AS_ACTION_NEVER
Never show this item as a button in an Action Bar.
intSHOW_AS_ACTION_IF_ROOM
Show this item as a button in an Action Bar if the system decides there is room for it.
intSHOW_AS_ACTION_ALWAYS
Always show this item as a button in an Action Bar.
intSHOW_AS_ACTION_WITH_TEXT
When this item is in the action bar, always show it with a text label even if it also has an icon specified.
intSHOW_AS_ACTION_COLLAPSE_ACTION_VIEW
This item's action view collapses to a normal menu item.

Method

booleancollapseActionView()
Collapse the action view associated with this menu item.
booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
booleanexpandActionView()
Expand the action view associated with this menu item.
ActionProvidergetActionProvider()
Gets the ActionProvider .
ViewgetActionView()
Returns the currently set action view for this menu item.
ClassgetClass()
Returns the runtime class of this Object .
intgetGroupId()
Return the group identifier that this menu item is part of.
DrawablegetIcon()
Returns the icon for this item as a Drawable (getting it from resources if it hasn't been loaded before).
IntentgetIntent()
Return the Intent associated with this item.
intgetItemId()
Return the identifier for this menu item.
ContextMenuInfogetMenuInfo()
Gets the extra information linked to this menu item.
intgetOrder()
Return the category and order within the category of this item.
SubMenugetSubMenu()
Get the sub-menu to be invoked when this item is selected, if it has one.
CharSequencegetTitle()
Retrieve the current title of the item.
CharSequencegetTitleCondensed()
Retrieve the current condensed title of the item.
booleanhasSubMenu()
Check whether this item has an associated sub-menu.
booleanisActionViewExpanded()
Returns true if this menu item's action view has been expanded.
booleanisCheckable()
Return whether the item can currently display a check mark.
booleanisChecked()
Return whether the item is currently displaying a check mark.
booleanisEnabled()
Return the enabled state of the menu item.
booleanisVisible()
Return the visibility of the menu item.
MenuItemsetActionProvider(ActionProvider actionProvider)
Sets the ActionProvider responsible for creating an action view if the item is placed on the action bar.
MenuItemsetActionView(View view)
Set an action view for this menu item.
MenuItemsetActionView(@LayoutRes int resId)
Set an action view for this menu item.
MenuItemsetAlphabeticShortcut(char alphaChar)
Change the alphabetic shortcut associated with this item.
MenuItemsetCheckable(boolean checkable)
Control whether this item can display a check mark.
MenuItemsetChecked(boolean checked)
Control whether this item is shown with a check mark.
MenuItemsetEnabled(boolean enabled)
Sets whether the menu item is enabled.
MenuItemsetIcon(Drawable icon)
Change the icon associated with this item.
MenuItemsetIcon(@DrawableRes int iconRes)
Change the icon associated with this item.
MenuItemsetIntent(Intent intent)
Change the Intent associated with this item.
MenuItemsetOnActionExpandListener(OnActionExpandListener listener)
Set an OnActionExpandListener on this menu item to be notified when the associated action view is expanded or collapsed.
MenuItemsetOnMenuItemClickListener(MenuItem.OnMenuItemClickListener menuItemClickListener)
Set a custom listener for invocation of this menu item.
voidsetShowAsAction(int actionEnum)
Sets how this item should display in the presence of an Action Bar.
MenuItemsetShowAsActionFlags(int actionEnum)
Sets how this item should display in the presence of an Action Bar.
MenuItemsetTitle(CharSequence title)
Change the title associated with this item.
MenuItemsetTitle(@StringRes int title)
Change the title associated with this item.
MenuItemsetTitleCondensed(CharSequence title)
Change the condensed title associated with this item.
MenuItemsetVisible(boolean visible)
Sets the visibility of the menu item.
StringtoString()
Returns a string representation of the object.