Android Guides | Samples

Android.App.Activity.OnContextItemSelected Method

This hook is called whenever an item in a context menu is selected.

Syntax

[Android.Runtime.Register("onContextItemSelected", "(Landroid/view/MenuItem;)Z", "GetOnContextItemSelected_Landroid_view_MenuItem_Handler")]
public virtual Boolean OnContextItemSelected (IMenuItem item)

Parameters

item
The context menu item that was selected.

Remarks

This hook is called whenever an item in a context menu is selected. The default implementation simply returns false to have the normal processing happen (calling the item's Runnable or sending a message to its Handler as appropriate). You can use this method for any items for which you would like to do processing without those other facilities.

Use IMenuItem.MenuInfo to get extra information set by the View that added this menu item.

Derived classes should call through to the base class for it to perform the default menu handling.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1