Android Guides | Samples

Android.Views.IMenu.AddSubMenu Method

Add a new sub-menu to the menu.


[Android.Runtime.Register("addSubMenu", "(IIILjava/lang/CharSequence;)Landroid/view/SubMenu;", "GetAddSubMenu_IIILjava_lang_CharSequence_Handler:Android.Views.IMenuInvoker, Mono.Android, Version=, Culture=neutral, PublicKeyToken=null")]
public ISubMenu AddSubMenu (Int32 groupId, Int32 itemId, Int32 order, ICharSequence title)


The group identifier that this item should be part of. This can also be used to define groups of items for batch state changes. Normally use Menu.None if an item should not be in a group.
Unique item ID. Use Menu.None if you do not need a unique ID.
The order for the item. Use Menu.None if you do not care about the order. See IMenuItem.Order.
The text to display for the item.


Add a new sub-menu to the menu. This item displays the given title for its label. To modify other attributes on the submenu's menu item, use ISubMenu.Item.

Note that you can only have one level of sub-menus, i.e. you cannnot add a subMenu to a subMenu: An UnsupportedOperationException will be thrown if you try.

[Android Documentation]


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