Share via


IMenuItem.SetEnabled(Boolean) Method

Definition

Sets whether the menu item is enabled.

[Android.Runtime.Register("setEnabled", "(Z)Landroid/view/MenuItem;", "GetSetEnabled_ZHandler:Android.Views.IMenuItemInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Android.Views.IMenuItem SetEnabled (bool enabled);
[<Android.Runtime.Register("setEnabled", "(Z)Landroid/view/MenuItem;", "GetSetEnabled_ZHandler:Android.Views.IMenuItemInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member SetEnabled : bool -> Android.Views.IMenuItem

Parameters

enabled
Boolean

If true then the item will be invokable; if false it is won't be invokable.

Returns

This Item so additional setters can be called.

Attributes

Remarks

Sets whether the menu item is enabled. Disabling a menu item will not allow it to be invoked via its shortcut. The menu item will still be visible.

Java documentation for android.view.MenuItem.setEnabled(boolean).

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