Android Guides | Samples

Android.Views.IMenu.AddSubMenu Method

Add a new sub-menu to the menu.

Syntax

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

Parameters

groupId
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.
itemId
Unique item ID. Use Menu.None if you do not need a unique ID.
order
The order for the item. Use Menu.None if you do not care about the order. See IMenuItem.Order.
title
The text to display for the item.

Remarks

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]

Requirements

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