Android Guides | Samples

Android.Views.Menu Class

Interface for managing the items in a menu.

See Also: Menu

Syntax

[Android.Runtime.Register("android/view/Menu")]
public abstract class Menu

Remarks

Interface for managing the items in a menu.

By default, every Activity supports an options menu of actions or options. You can add items to this menu and handle clicks on your additions. The easiest way of adding menu items is inflating an XML file into the Menu via MenuInflater. The easiest way of attaching code to clicks is via Activity.OnOptionsItemSelected(IMenuItem) and Activity.OnContextItemSelected(IMenuItem).

Different menu types support different features:

  1. Context menus: Do not support item shortcuts and item icons.
  2. Options menus: The icon menus do not support item check marks and only show the item's IMenuItem.SetTitleCondensed(ICharSequence). The expanded menus (only available if six or more menu items are visible, reached via the 'More' item in the icon menu) do not show item icons, and item check marks are discouraged.
  3. Sub menus: Do not support item icons, or nested sub menus.

Developer Guides

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

[Android Documentation]

Requirements

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

The members of Android.Views.Menu are listed below.

See Also: Object

Public Fields

const
FirstInt32 (1). First value for group and item identifier integers.
const
NoneInt32 (0). Value to use for group and item identifier integers when you don't care about them.