public class NavigationMenu extends MenuBuilder
MenuBuilder
that returns an instance of NavigationSubMenu
instead of
SubMenuBuilder
when a sub menu is created.MenuBuilder.Callback, MenuBuilder.ItemInvoker
CATEGORY_MASK, CATEGORY_SHIFT, FLAG_KEEP_OPEN_ON_SUBMENU_OPENED, USER_MASK, USER_SHIFT
CATEGORY_ALTERNATIVE, CATEGORY_CONTAINER, CATEGORY_SECONDARY, CATEGORY_SYSTEM, FIRST, FLAG_ALWAYS_PERFORM_CLOSE, FLAG_APPEND_TO_GROUP, FLAG_PERFORM_NO_CLOSE, NONE
Constructor and Description |
---|
NavigationMenu(Context context) |
Modifier and Type | Method and Description |
---|---|
SubMenu |
addSubMenu(int group,
int id,
int categoryOrder,
CharSequence title)
Add a new sub-menu to the menu.
|
add, add, add, add, addIntentOptions, addInternal, addMenuPresenter, addMenuPresenter, addSubMenu, addSubMenu, addSubMenu, changeMenuMode, clear, clearAll, clearHeader, close, close, collapseItemActionView, expandItemActionView, findGroupIndex, findGroupIndex, findItem, findItemIndex, flagActionItems, getActionItems, getActionViewStatesKey, getContext, getExpandedItem, getHeaderIcon, getHeaderTitle, getHeaderView, getItem, getNonActionItems, getRootMenu, getVisibleItems, hasVisibleItems, isShortcutKey, isShortcutsVisible, onItemsChanged, performIdentifierAction, performItemAction, performItemAction, performShortcut, removeGroup, removeItem, removeItemAt, removeMenuPresenter, restoreActionViewStates, restorePresenterStates, saveActionViewStates, savePresenterStates, setCallback, setCurrentMenuInfo, setDefaultShowAsAction, setGroupCheckable, setGroupEnabled, setGroupVisible, setHeaderIconInt, setHeaderIconInt, setHeaderTitleInt, setHeaderTitleInt, setHeaderViewInt, setOptionalIconsVisible, setOverrideVisibleItems, setQwertyMode, setShortcutsVisible, size, startDispatchingItemsChanged, stopDispatchingItemsChanged
public NavigationMenu(Context context)
public SubMenu addSubMenu(int group, int id, int categoryOrder, CharSequence title)
Menu
SubMenu.getItem()
.
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.
addSubMenu
in interface Menu
addSubMenu
in class MenuBuilder
group
- 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.id
- Unique item ID. Use Menu.NONE
if you do not need a
unique ID.categoryOrder
- The order for the item. Use Menu.NONE
if you do not care
about the order. See MenuItem.getOrder()
.title
- The text to display for the item.