Example usage for Java android.view MenuItem fields, constructors, methods, implement or subclass
The text is from its open source code.
int | SHOW_AS_ACTION_NEVER Never show this item as a button in an Action Bar. |
int | SHOW_AS_ACTION_IF_ROOM Show this item as a button in an Action Bar if the system decides there is room for it. |
int | SHOW_AS_ACTION_ALWAYS Always show this item as a button in an Action Bar. |
int | SHOW_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. |
int | SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW This item's action view collapses to a normal menu item. |
boolean | collapseActionView() Collapse the action view associated with this menu item. |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
boolean | expandActionView() Expand the action view associated with this menu item. |
ActionProvider | getActionProvider() Gets the ActionProvider . |
View | getActionView() Returns the currently set action view for this menu item. |
Class> | getClass() Returns the runtime class of this Object . |
int | getGroupId() Return the group identifier that this menu item is part of. |
Drawable | getIcon() Returns the icon for this item as a Drawable (getting it from resources if it hasn't been loaded before). |
Intent | getIntent() Return the Intent associated with this item. |
int | getItemId() Return the identifier for this menu item. |
ContextMenuInfo | getMenuInfo() Gets the extra information linked to this menu item. |
int | getOrder() Return the category and order within the category of this item. |
SubMenu | getSubMenu() Get the sub-menu to be invoked when this item is selected, if it has one. |
CharSequence | getTitle() Retrieve the current title of the item. |
CharSequence | getTitleCondensed() Retrieve the current condensed title of the item. |
boolean | hasSubMenu() Check whether this item has an associated sub-menu. |
boolean | isActionViewExpanded() Returns true if this menu item's action view has been expanded. |
boolean | isCheckable() Return whether the item can currently display a check mark. |
boolean | isChecked() Return whether the item is currently displaying a check mark. |
boolean | isEnabled() Return the enabled state of the menu item. |
boolean | isVisible() Return the visibility of the menu item. |
MenuItem | setActionProvider(ActionProvider actionProvider) Sets the ActionProvider responsible for creating an action view if the item is placed on the action bar. |
MenuItem | setActionView(View view) Set an action view for this menu item. |
MenuItem | setActionView(@LayoutRes int resId) Set an action view for this menu item. |
MenuItem | setAlphabeticShortcut(char alphaChar) Change the alphabetic shortcut associated with this item. |
MenuItem | setCheckable(boolean checkable) Control whether this item can display a check mark. |
MenuItem | setChecked(boolean checked) Control whether this item is shown with a check mark. |
MenuItem | setEnabled(boolean enabled) Sets whether the menu item is enabled. |
MenuItem | setIcon(Drawable icon) Change the icon associated with this item. |
MenuItem | setIcon(@DrawableRes int iconRes) Change the icon associated with this item. |
MenuItem | setIntent(Intent intent) Change the Intent associated with this item. |
MenuItem | setOnActionExpandListener(OnActionExpandListener listener) Set an OnActionExpandListener on this menu item to be notified when the associated action view is expanded or collapsed. |
MenuItem | setOnMenuItemClickListener(MenuItem.OnMenuItemClickListener menuItemClickListener) Set a custom listener for invocation of this menu item. |
void | setShowAsAction(int actionEnum) Sets how this item should display in the presence of an Action Bar. |
MenuItem | setShowAsActionFlags(int actionEnum) Sets how this item should display in the presence of an Action Bar. |
MenuItem | setTitle(CharSequence title) Change the title associated with this item. |
MenuItem | setTitle(@StringRes int title) Change the title associated with this item. |
MenuItem | setTitleCondensed(CharSequence title) Change the condensed title associated with this item. |
MenuItem | setVisible(boolean visible) Sets the visibility of the menu item. |
String | toString() Returns a string representation of the object. |