IMenuItem Interface

Definition

Interface for direct access to a previously created menu item.

[Android.Runtime.Register("android/view/MenuItem", "", "Android.Views.IMenuItemInvoker")]
public interface IMenuItem : Android.Runtime.IJavaObject, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/view/MenuItem", "", "Android.Views.IMenuItemInvoker")>]
type IMenuItem = interface
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Attributes
Implements

Remarks

Interface for direct access to a previously created menu item.

An Item is returned by calling one of the android.view.Menu#add methods.

For a feature set of specific menu types, see Menu.

<div class="special reference"> <h3>Developer Guides</h3>

For information about creating menus, read the Menus developer guide.

</div>

Java documentation for android.view.MenuItem.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Properties

ActionProvider

Gets the ActionProvider.

ActionView

Returns the currently set action view for this menu item.

AlphabeticModifiers

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

AlphabeticShortcut

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

ContentDescription
ContentDescriptionFormatted

Retrieve the content description associated with this menu item.

GroupId

Return the group identifier that this menu item is part of.

Handle

Gets the JNI value of the underlying Android object.

(Inherited from IJavaObject)
HasSubMenu

Check whether this item has an associated sub-menu.

Icon

Returns the icon for this item as a Drawable (getting it from resources if it hasn't been loaded before).

IconTintBlendMode

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

IconTintList
IconTintMode

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

Intent

Return the Intent associated with this item.

IsActionViewExpanded

Returns true if this menu item's action view has been expanded.

IsCheckable

Return whether the item can currently display a check mark.

IsChecked

Return whether the item is currently displaying a check mark.

IsEnabled

Return the enabled state of the menu item.

IsVisible

Return the visibility of the menu item.

ItemId

Return the identifier for this menu item.

JniIdentityHashCode

Returns the value of java.lang.System.identityHashCode() for the wrapped instance.

(Inherited from IJavaPeerable)
JniManagedPeerState

State of the managed peer.

(Inherited from IJavaPeerable)
JniPeerMembers

Member access and invocation support.

(Inherited from IJavaPeerable)
MenuInfo

Gets the extra information linked to this menu item.

NumericModifiers

Return the modifiers for this menu item's numeric (12-key) shortcut.

NumericShortcut

Return the char for this menu item's numeric (12-key) shortcut.

Order

Return the category and order within the category of this item.

PeerReference

Returns a JniObjectReference of the wrapped Java object instance.

(Inherited from IJavaPeerable)
SubMenu

Get the sub-menu to be invoked when this item is selected, if it has one.

TitleCondensedFormatted

Retrieve the current condensed title of the item.

TitleFormatted

Retrieve the current title of the item.

TooltipText
TooltipTextFormatted

Retrieve the tooltip text associated with this menu item.

Methods

CollapseActionView()

Collapse the action view associated with this menu item.

Disposed()

Called when the instance has been disposed.

(Inherited from IJavaPeerable)
DisposeUnlessReferenced()

If there are no outstanding references to this instance, then calls Dispose(); otherwise, does nothing.

(Inherited from IJavaPeerable)
ExpandActionView()

Expand the action view associated with this menu item.

Finalized()

Called when the instance has been finalized.

(Inherited from IJavaPeerable)
SetActionProvider(ActionProvider)

Sets the ActionProvider responsible for creating an action view if the item is placed on the action bar.

SetActionView(Int32)

Set an action view for this menu item.

SetActionView(View)

Set an action view for this menu item.

SetAlphabeticShortcut(Char, Int32)

Change the alphabetic shortcut associated with this item.

SetAlphabeticShortcut(Char)

Change the alphabetic shortcut associated with this item.

SetCheckable(Boolean)

Control whether this item can display a check mark.

SetChecked(Boolean)

Control whether this item is shown with a check mark.

SetContentDescription(ICharSequence)

Change the content description associated with this menu item.

SetContentDescription(String)

Change the content description associated with this menu item.

SetEnabled(Boolean)

Sets whether the menu item is enabled.

SetIcon(Drawable)

Change the icon associated with this item.

SetIcon(Int32)

Change the icon associated with this item.

SetIconTintBlendMode(BlendMode)

Specifies the blending mode used to apply the tint specified by #setIconTintList(ColorStateList) to this item's icon.

SetIconTintList(ColorStateList)

Applies a tint to this item's icon.

SetIconTintMode(PorterDuff+Mode)

Specifies the blending mode used to apply the tint specified by #setIconTintList(ColorStateList) to this item's icon.

SetIntent(Intent)

Change the Intent associated with this item.

SetJniIdentityHashCode(Int32)

Set the value returned by JniIdentityHashCode.

(Inherited from IJavaPeerable)
SetJniManagedPeerState(JniManagedPeerStates) (Inherited from IJavaPeerable)
SetNumericShortcut(Char, Int32)

Change the numeric shortcut and modifiers associated with this item.

SetNumericShortcut(Char)

Change the numeric shortcut associated with this item.

SetOnActionExpandListener(IMenuItemOnActionExpandListener)

Set an OnActionExpandListener on this menu item to be notified when the associated action view is expanded or collapsed.

SetOnMenuItemClickListener(IMenuItemOnMenuItemClickListener)

Set a custom listener for invocation of this menu item.

SetPeerReference(JniObjectReference)

Set the value returned by PeerReference.

(Inherited from IJavaPeerable)
SetShortcut(Char, Char, Int32, Int32)

Change both the numeric and alphabetic shortcut associated with this item.

SetShortcut(Char, Char)

Change both the numeric and alphabetic shortcut associated with this item.

SetShowAsAction(ShowAsAction)

Sets how this item should display in the presence of an Action Bar.

SetShowAsActionFlags(ShowAsAction)

Sets how this item should display in the presence of an Action Bar.

SetTitle(ICharSequence)

Change the title associated with this item.

SetTitle(Int32)

Change the title associated with this item.

SetTitleCondensed(ICharSequence)

Change the condensed title associated with this item.

SetTooltipText(ICharSequence)

Change the tooltip text associated with this menu item.

SetTooltipText(String)

Change the tooltip text associated with this menu item.

SetVisible(Boolean)

Sets the visibility of the menu item.

UnregisterFromRuntime()

Unregister this instance so that the runtime will not return it from future Java.Interop.JniRuntime+JniValueManager.PeekValue invocations.

(Inherited from IJavaPeerable)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

SetContentDescription(IMenuItem, String)
SetTitle(IMenuItem, String)
SetTitleCondensed(IMenuItem, String)
SetTooltipText(IMenuItem, String)
JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to