setMenuItemEnabled

abstract fun setMenuItemEnabled(@IdRes id: Int, enabled: Boolean): Boolean

Enables or disables a menu item by its ID.

Return

{@code true} if the menu item was found and updated, {@code false} otherwise.

Parameters

id

The resource ID of the menu item.

enabled

Whether the menu item should be enabled.