added in version 22.1.0
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1

MenuItemCompat

public final class MenuItemCompat
extends Object

java.lang.Object
   ↳ android.support.v4.view.MenuItemCompat


Helper for accessing features in MenuItem.

Note: You cannot get an instance of this class. Instead, it provides static methods that correspond to the methods in MenuItem, but take a MenuItem object as an additional argument.

Summary

Nested classes

interface MenuItemCompat.OnActionExpandListener

This interface was deprecated in API level 26.1.0. Use MenuItem.OnActionExpandListener directly.  

Constants

int SHOW_AS_ACTION_ALWAYS

This constant was deprecated in API level 26.1.0. Use SHOW_AS_ACTION_ALWAYS directly.

int SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW

This constant was deprecated in API level 26.1.0. Use SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW directly.

int SHOW_AS_ACTION_IF_ROOM

This constant was deprecated in API level 26.1.0. Use SHOW_AS_ACTION_IF_ROOM directly.

int SHOW_AS_ACTION_NEVER

This constant was deprecated in API level 26.1.0. Use SHOW_AS_ACTION_NEVER directly.

int SHOW_AS_ACTION_WITH_TEXT

This constant was deprecated in API level 26.1.0. Use SHOW_AS_ACTION_WITH_TEXT directly.

Public methods

static boolean collapseActionView(MenuItem item)

This method was deprecated in API level 26.1.0. Use collapseActionView() directly.

static boolean expandActionView(MenuItem item)

This method was deprecated in API level 26.1.0. Use expandActionView() directly.

static ActionProvider getActionProvider(MenuItem item)

Gets the ActionProvider.

static View getActionView(MenuItem item)

This method was deprecated in API level 26.1.0. Use getActionView() directly.

static int getAlphabeticModifiers(MenuItem item)

Return the modifier for this menu item's alphabetic shortcut.

static CharSequence getContentDescription(MenuItem item)

Retrieve the content description associated with this menu item.

static ColorStateList getIconTintList(MenuItem item)
static PorterDuff.Mode getIconTintMode(MenuItem item)

Returns the blending mode used to apply the tint to the item's icon, if specified.

static int getNumericModifiers(