Sdílet prostřednictvím


IContextMenu Interface

Definition

Extension of Menu for context menus providing functionality to modify the header of the context menu.

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

Remarks

Extension of Menu for context menus providing functionality to modify the header of the context menu.

Context menus do not support item shortcuts and item icons.

To show a context menu on long click, most clients will want to call Activity#registerForContextMenu and override Activity#onCreateContextMenu.

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

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

</div>

Java documentation for android.view.ContextMenu.

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.

Fields

First

First value for group and item identifier integers.

(Inherited from IMenu)
None

Value to use for group and item identifier integers when you don't care about them.

(Inherited from IMenu)
SupportedModifiersMask

A mask of all supported modifiers for MenuItem's keyboard shortcuts

(Inherited from IMenu)

Properties

Handle

Gets the JNI value of the underlying Android object.

(Inherited from IJavaObject)
HasVisibleItems

Return whether the menu currently has item items that are visible.

(Inherited from IMenu)
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)
PeerReference

Returns a JniObjectReference of the wrapped Java object instance.

(Inherited from IJavaPeerable)

Methods

Add(ICharSequence)

Add a new item to the menu.

(Inherited from IMenu)
Add(Int32, Int32, Int32, ICharSequence)

Add a new item to the menu.

(Inherited from IMenu)
Add(Int32, Int32, Int32, Int32)

Variation on #add(int, int, int, CharSequence) that takes a string resource identifier instead of the string itself.

(Inherited from IMenu)
Add(Int32)

Add a new item to the menu.

(Inherited from IMenu)
AddIntentOptions(Int32, Int32, Int32, ComponentName, Intent[], Intent, MenuAppendFlags, IMenuItem[])

Add a group of menu items corresponding to actions that can be performed for a particular Intent.

(Inherited from IMenu)
AddSubMenu(ICharSequence)

Add a new sub-menu to the menu.

(Inherited from IMenu)
AddSubMenu(Int32, Int32, Int32, ICharSequence)

Add a new sub-menu to the menu.

(Inherited from IMenu)
AddSubMenu(Int32, Int32, Int32, Int32)

Variation on #addSubMenu(int, int, int, CharSequence) that takes a string resource identifier for the title instead of the string itself.

(Inherited from IMenu)
AddSubMenu(Int32)

Add a new sub-menu to the menu.

(Inherited from IMenu)
Clear()

Remove all existing items from the menu, leaving it empty as if it had just been created.

(Inherited from IMenu)
ClearHeader()

Clears the header of the context menu.

Close()

Closes the menu, if open.

(Inherited from IMenu)
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)
Finalized()

Called when the instance has been finalized.

(Inherited from IJavaPeerable)
FindItem(Int32)

Return the menu item with a particular identifier.

(Inherited from IMenu)
GetItem(Int32)

Gets the menu item at the given index.

(Inherited from IMenu)
IsShortcutKey(Keycode, KeyEvent)

Is a keypress one of the defined shortcut keys for this window.

(Inherited from IMenu)
PerformIdentifierAction(Int32, MenuPerformFlags)

Execute the menu item action associated with the given menu identifier.

(Inherited from IMenu)
PerformShortcut(Keycode, KeyEvent, MenuPerformFlags)

Execute the menu item action associated with the given shortcut character.

(Inherited from IMenu)
RemoveGroup(Int32)

Remove all items in the given group.

(Inherited from IMenu)
RemoveItem(Int32)

Remove the item with the given identifier.

(Inherited from IMenu)
SetGroupCheckable(Int32, Boolean, Boolean)

Control whether a particular group of items can show a check mark.

(Inherited from IMenu)
SetGroupDividerEnabled(Boolean)

Enable or disable the group dividers.

(Inherited from IMenu)
SetGroupEnabled(Int32, Boolean)

Enable or disable all menu items that are in the given group.

(Inherited from IMenu)
SetGroupVisible(Int32, Boolean)

Show or hide all menu items that are in the given group.

(Inherited from IMenu)
SetHeaderIcon(Drawable)

Sets the context menu header's icon to the icon given in <var>icon</var> Drawable.

SetHeaderIcon(Int32)

Sets the context menu header's icon to the icon given in <var>iconRes</var> resource id.

SetHeaderTitle(ICharSequence)

Sets the context menu header's title to the title given in <var>title</var>.

SetHeaderTitle(Int32)

Sets the context menu header's title to the title given in <var>titleRes</var> resource identifier.

SetHeaderView(View)

Sets the header of the context menu to the View given in <var>view</var>.

SetJniIdentityHashCode(Int32)

Set the value returned by JniIdentityHashCode.

(Inherited from IJavaPeerable)
SetJniManagedPeerState(JniManagedPeerStates) (Inherited from IJavaPeerable)
SetPeerReference(JniObjectReference)

Set the value returned by PeerReference.

(Inherited from IJavaPeerable)
SetQwertyMode(Boolean)

Control whether the menu should be running in qwerty mode (alphabetic shortcuts) or 12-key mode (numeric shortcuts).

(Inherited from IMenu)
Size()

Get the number of items in the menu.

(Inherited from IMenu)
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.

SetHeaderTitle(IContextMenu, String)
Add(IMenu, Int32, Int32, Int32, String)
Add(IMenu, String)
AddSubMenu(IMenu, Int32, Int32, Int32, String)
AddSubMenu(IMenu, String)
JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to