Activity.OnMenuItemSelected(Int32, IMenuItem) Method

Definition

Default implementation of Window.Callback.onMenuItemSelected(int, MenuItem) for activities.

[Android.Runtime.Register("onMenuItemSelected", "(ILandroid/view/MenuItem;)Z", "GetOnMenuItemSelected_ILandroid_view_MenuItem_Handler")]
public virtual bool OnMenuItemSelected(int featureId, Android.Views.IMenuItem item);
[<Android.Runtime.Register("onMenuItemSelected", "(ILandroid/view/MenuItem;)Z", "GetOnMenuItemSelected_ILandroid_view_MenuItem_Handler")>]
abstract member OnMenuItemSelected : int * Android.Views.IMenuItem -> bool
override this.OnMenuItemSelected : int * Android.Views.IMenuItem -> bool

Parameters

featureId
Int32

int: The panel that the menu is in.

item
IMenuItem

MenuItem: This value cannot be null.

Returns

boolean Return true to finish processing of selection, or false to perform the normal menu handling (calling its Runnable or sending a Message to its target Handler).

Implements

Attributes

Remarks

Default implementation of Window.Callback.onMenuItemSelected(int, MenuItem) for activities. This calls through to the new onOptionsItemSelected(MenuItem) method for the Window.FEATURE_OPTIONS_PANEL panel, so that subclasses of Activity don't need to deal with feature codes.

Android reference for android.app.Activity.onMenuItemSelected.

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.

Applies to