android.view
public
interface
android.view.SubMenu
android.view.SubMenu |
Menu
|
Subclass of Menu for sub menus.
Sub menus do not support item icons, or nested sub menus.
Summary
Constants inherited
from interface
android.view.Menu
|
|
|
Value |
|
int |
CATEGORY_ALTERNATIVE |
Category code for the order integer for items/groups that are
alternative actions on the data that is currently displayed -- or/add
this with your base value. |
262144 |
0x00040000 |
int |
CATEGORY_CONTAINER |
Category code for the order integer for items/groups that are part of a
container -- or/add this with your base value. |
65536 |
0x00010000 |
int |
CATEGORY_SECONDARY |
Category code for the order integer for items/groups that are
user-supplied secondary (infrequently used) options -- or/add this with
your base value. |
196608 |
0x00030000 |
int |
CATEGORY_SYSTEM |
Category code for the order integer for items/groups that are provided by
the system -- or/add this with your base value. |
131072 |
0x00020000 |
int |
FIRST |
First value for group and item identifier integers. |
1 |
0x00000001 |
int |
FLAG_ALWAYS_PERFORM_CLOSE |
Flag for performShortcut(int, KeyEvent, int): if set, always
close the menu after executing the shortcut. |
2 |
0x00000002 |
int |
FLAG_APPEND_TO_GROUP |
Flag for addIntentOptions(int, int, int, ComponentName, Intent[], Intent, int, MenuItem[]): if set, do not automatically remove
any existing menu items in the same group. |
1 |
0x00000001 |
int |
FLAG_PERFORM_NO_CLOSE |
Flag for performShortcut(int, KeyEvent, int): if set, do not close the menu after
executing the shortcut. |
1 |
0x00000001 |
int |
NONE |
Value to use for group and item identifier integers when you don't care
about them. |
0 |
0x00000000 |
Public Methods
add,
add,
add,
add,
addIntentOptions,
addSubMenu,
addSubMenu,
addSubMenu,
addSubMenu,
clear,
findItem,
hasVisibleItems,
isShortcutKey,
performIdentifierAction,
performShortcut,
removeGroup,
removeItem,
setGroupCheckable,
setGroupEnabled,
setGroupVisible,
setQwertyMode,
size
|
|
|
|
|
MenuItem |
add(int titleRes) |
|
|
|
|
|
MenuItem |
add(int groupId, int itemId, int order, CharSequence title) |
|
|
|
|
|
MenuItem |
add(int groupId, int itemId, int order, int titleRes) |
|
|
|
|
|
MenuItem |
add(CharSequence title) |
|
|
|
|
|
int |
addIntentOptions(int groupId, int itemId, int order, ComponentName caller, Intent[] specifics, Intent intent, int flags, MenuItem[] outSpecificItems) |
|
|
|
|
|
SubMenu |
addSubMenu(int titleRes) |
|
|
|
|
|
SubMenu |
addSubMenu(int groupId, int itemId, int order, int titleRes) |
|
|
|
|
|
SubMenu |
addSubMenu(CharSequence title) |
|
|
|
|
|
SubMenu |
addSubMenu(int groupId, int itemId, int order, CharSequence title) |
|
|
|
|
|
void |
clear() |
|
|
|
|
|
MenuItem |
findItem(int id) |
|
|
|
|
|
boolean |
hasVisibleItems() |
|
|
|
|
|
boolean |
isShortcutKey(int keyCode, KeyEvent event) |
|
|
|
|
|
boolean |
performIdentifierAction(int id, int flags) |
|
|
|
|
|
boolean |
performShortcut(int keyCode, KeyEvent event, int flags) |
|
|
|
|
|
void |
removeGroup(int groupId) |
|
|
|
|
|
void |
removeItem(int id) |
|
|
|
|
|
void |
setGroupCheckable(int group, boolean checkable, boolean exclusive) |
|
|
|
|
|
void |
setGroupEnabled(int group, boolean enabled) |
|
|
|
|
|
void |
setGroupVisible(int group, boolean visible) |
|
|
|
|
|
void |
setQwertyMode(boolean isQwerty) |
|
|
|
|
|
int |
size() |
Details
Public Methods
public
void
clearHeader()
Clears the header of the submenu.
public
MenuItem
getItem()
Gets the
MenuItem that represents this submenu in the parent
menu. Use this for setting additional item attributes.
Returns
- The MenuItem that launches the submenu when invoked.
Sets the submenu header's icon to the icon given in
icon
Drawable.
Returns
- This SubMenu so additional setters can be called.
public
SubMenu
setHeaderIcon(int iconRes)
Sets the submenu header's icon to the icon given in
iconRes
resource id.
Parameters
iconRes
| The resource identifier used for the icon. |
Returns
- This SubMenu so additional setters can be called.
public
SubMenu
setHeaderTitle(int titleRes)
Sets the submenu header's title to the title given in
titleRes
resource identifier.
Parameters
titleRes
| The string resource identifier used for the title. |
Returns
- This SubMenu so additional setters can be called.
Sets the submenu header's title to the title given in
title.
Parameters
title
| The character sequence used for the title. |
Returns
- This SubMenu so additional setters can be called.
public
SubMenu
setHeaderView(View view)
Sets the header of the submenu to the
View given in
view. This replaces the header title and icon (and those
replace this).
Parameters
view
| The View used for the header. |
Returns
- This SubMenu so additional setters can be called.
Change the icon associated with this submenu's item in its parent menu.
Parameters
icon
| The new icon (as a Drawable) to be displayed. |
Returns
- This SubMenu so additional setters can be called.
public
SubMenu
setIcon(int iconRes)
Change the icon associated with this submenu's item in its parent menu.
Parameters
iconRes
| The new icon (as a resource ID) to be displayed. |
Returns
- This SubMenu so additional setters can be called.