# SubMenu

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Inherited Constants](https://developer.android.com/reference/android/view/SubMenu#inhconstants)\|[Methods](https://developer.android.com/reference/android/view/SubMenu#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/view/SubMenu#inhmethods)  

# SubMenu

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/view/SubMenu "View this page in Kotlin")\|Java

`
public


interface
SubMenu
`  
`


implements

`[Menu](https://developer.android.com/reference/android/view/Menu)`


`

|----------------------|
| android.view.SubMenu |

<br />

*** ** * ** ***

Subclass of[Menu](https://developer.android.com/reference/android/view/Menu)for sub menus.

Sub menus do not support item icons, or nested sub menus.  

### Developer Guides

For information about creating menus, read the[Menus](https://developer.android.com/guide/topics/ui/menus)developer guide.

<br />

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[android.view.Menu](https://developer.android.com/reference/android/view/Menu) |-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [CATEGORY_ALTERNATIVE](https://developer.android.com/reference/android/view/Menu#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.                                                                                                                                                                                                                                  | | `int` | [CATEGORY_CONTAINER](https://developer.android.com/reference/android/view/Menu#CATEGORY_CONTAINER) Category code for the order integer for items/groups that are part of a container -- or/add this with your base value.                                                                                                                                                                                                                                                                              | | `int` | [CATEGORY_SECONDARY](https://developer.android.com/reference/android/view/Menu#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.                                                                                                                                                                                                                                              | | `int` | [CATEGORY_SYSTEM](https://developer.android.com/reference/android/view/Menu#CATEGORY_SYSTEM) Category code for the order integer for items/groups that are provided by the system -- or/add this with your base value.                                                                                                                                                                                                                                                                                 | | `int` | [FIRST](https://developer.android.com/reference/android/view/Menu#FIRST) First value for group and item identifier integers.                                                                                                                                                                                                                                                                                                                                                                           | | `int` | [FLAG_ALWAYS_PERFORM_CLOSE](https://developer.android.com/reference/android/view/Menu#FLAG_ALWAYS_PERFORM_CLOSE) Flag for[performShortcut(int, android.view.KeyEvent, int)](https://developer.android.com/reference/android/view/Menu#performShortcut(int,%20android.view.KeyEvent,%20int)): if set, always close the menu after executing the shortcut.                                                                                                                                               | | `int` | [FLAG_APPEND_TO_GROUP](https://developer.android.com/reference/android/view/Menu#FLAG_APPEND_TO_GROUP) Flag for[addIntentOptions(int, int, int, ComponentName, Intent, Intent, int, MenuItem)](https://developer.android.com/reference/android/view/Menu#addIntentOptions(int,%20int,%20int,%20android.content.ComponentName,%20android.content.Intent[],%20android.content.Intent,%20int,%20android.view.MenuItem[])): if set, do not automatically remove any existing menu items in the same group. | | `int` | [FLAG_PERFORM_NO_CLOSE](https://developer.android.com/reference/android/view/Menu#FLAG_PERFORM_NO_CLOSE) Flag for[performShortcut(int, KeyEvent, int)](https://developer.android.com/reference/android/view/Menu#performShortcut(int,%20android.view.KeyEvent,%20int)): if set, do not close the menu after executing the shortcut.                                                                                                                                                                    | | `int` | [NONE](https://developer.android.com/reference/android/view/Menu#NONE) Value to use for group and item identifier integers when you don't care about them.                                                                                                                                                                                                                                                                                                                                             | | `int` | [SUPPORTED_MODIFIERS_MASK](https://developer.android.com/reference/android/view/Menu#SUPPORTED_MODIFIERS_MASK) A mask of all supported modifiers for MenuItem's keyboard shortcuts                                                                                                                                                                                                                                                                                                                     | |

|                                                                                                                                                                                                                                          ### Public methods                                                                                                                                                                                                                                          ||
|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void`                                                                      | ` `[clearHeader](https://developer.android.com/reference/android/view/SubMenu#clearHeader())`() ` Clears the header of the submenu.                                                                                                                                                                                                                                                                           |
| ` abstract `[MenuItem](https://developer.android.com/reference/android/view/MenuItem) | ` `[getItem](https://developer.android.com/reference/android/view/SubMenu#getItem())`() ` Gets the[MenuItem](https://developer.android.com/reference/android/view/MenuItem)that represents this submenu in the parent menu.                                                                                                                                                                                   |
| ` abstract `[SubMenu](https://developer.android.com/reference/android/view/SubMenu)   | ` `[setHeaderIcon](https://developer.android.com/reference/android/view/SubMenu#setHeaderIcon(int))`(int iconRes) ` Sets the submenu header's icon to the icon given in<var translate="no">iconRes</var>resource id.                                                                                                                                                                                          |
| ` abstract `[SubMenu](https://developer.android.com/reference/android/view/SubMenu)   | ` `[setHeaderIcon](https://developer.android.com/reference/android/view/SubMenu#setHeaderIcon(android.graphics.drawable.Drawable))`(`[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable)` icon) ` Sets the submenu header's icon to the icon given in<var translate="no">icon</var>[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable). |
| ` abstract `[SubMenu](https://developer.android.com/reference/android/view/SubMenu)   | ` `[setHeaderTitle](https://developer.android.com/reference/android/view/SubMenu#setHeaderTitle(int))`(int titleRes) ` Sets the submenu header's title to the title given in<var translate="no">titleRes</var>resource identifier.                                                                                                                                                                            |
| ` abstract `[SubMenu](https://developer.android.com/reference/android/view/SubMenu)   | ` `[setHeaderTitle](https://developer.android.com/reference/android/view/SubMenu#setHeaderTitle(java.lang.CharSequence))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` title) ` Sets the submenu header's title to the title given in<var translate="no">title</var>.                                                                                                     |
| ` abstract `[SubMenu](https://developer.android.com/reference/android/view/SubMenu)   | ` `[setHeaderView](https://developer.android.com/reference/android/view/SubMenu#setHeaderView(android.view.View))`(`[View](https://developer.android.com/reference/android/view/View)` view) ` Sets the header of the submenu to the[View](https://developer.android.com/reference/android/view/View)given in<var translate="no">view</var>.                                                                  |
| ` abstract `[SubMenu](https://developer.android.com/reference/android/view/SubMenu)   | ` `[setIcon](https://developer.android.com/reference/android/view/SubMenu#setIcon(android.graphics.drawable.Drawable))`(`[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable)` icon) ` Change the icon associated with this submenu's item in its parent menu.                                                                                                              |
| ` abstract `[SubMenu](https://developer.android.com/reference/android/view/SubMenu)   | ` `[setIcon](https://developer.android.com/reference/android/view/SubMenu#setIcon(int))`(int iconRes) ` Change the icon associated with this submenu's item in its parent menu.                                                                                                                                                                                                                               |

| ### Inherited methods |
|-----------------------|---|
| From interface` `[android.view.Menu](https://developer.android.com/reference/android/view/Menu)` ` |---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract `[MenuItem](https://developer.android.com/reference/android/view/MenuItem) | ` `[add](https://developer.android.com/reference/android/view/Menu#add(int,%20int,%20int,%20java.lang.CharSequence))`(int groupId, int itemId, int order, `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` title) ` Add a new item to the menu.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | ` abstract `[MenuItem](https://developer.android.com/reference/android/view/MenuItem) | ` `[add](https://developer.android.com/reference/android/view/Menu#add(int))`(int titleRes) ` Add a new item to the menu.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` abstract `[MenuItem](https://developer.android.com/reference/android/view/MenuItem) | ` `[add](https://developer.android.com/reference/android/view/Menu#add(java.lang.CharSequence))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` title) ` Add a new item to the menu.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | ` abstract `[MenuItem](https://developer.android.com/reference/android/view/MenuItem) | ` `[add](https://developer.android.com/reference/android/view/Menu#add(int,%20int,%20int,%20int))`(int groupId, int itemId, int order, int titleRes) ` Variation on[add(int, int, int, java.lang.CharSequence)](https://developer.android.com/reference/android/view/Menu#add(int,%20int,%20int,%20java.lang.CharSequence))that takes a string resource identifier instead of the string itself.                                                                                                                                                                                                                                                                                                                                                                              | | ` abstract int`                                                                       | ` `[addIntentOptions](https://developer.android.com/reference/android/view/Menu#addIntentOptions(int,%20int,%20int,%20android.content.ComponentName,%20android.content.Intent[],%20android.content.Intent,%20int,%20android.view.MenuItem[]))`(int groupId, int itemId, int order, `[ComponentName](https://developer.android.com/reference/android/content/ComponentName)` caller, `[Intent[]](https://developer.android.com/reference/android/content/Intent)` specifics, `[Intent](https://developer.android.com/reference/android/content/Intent)` intent, int flags, `[MenuItem[]](https://developer.android.com/reference/android/view/MenuItem)` outSpecificItems) ` Add a group of menu items corresponding to actions that can be performed for a particular Intent. | | ` abstract `[SubMenu](https://developer.android.com/reference/android/view/SubMenu)   | ` `[addSubMenu](https://developer.android.com/reference/android/view/Menu#addSubMenu(java.lang.CharSequence))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` title) ` Add a new sub-menu to the menu.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` abstract `[SubMenu](https://developer.android.com/reference/android/view/SubMenu)   | ` `[addSubMenu](https://developer.android.com/reference/android/view/Menu#addSubMenu(int,%20int,%20int,%20int))`(int groupId, int itemId, int order, int titleRes) ` Variation on[addSubMenu(int, int, int, java.lang.CharSequence)](https://developer.android.com/reference/android/view/Menu#addSubMenu(int,%20int,%20int,%20java.lang.CharSequence))that takes a string resource identifier for the title instead of the string itself.                                                                                                                                                                                                                                                                                                                                    | | ` abstract `[SubMenu](https://developer.android.com/reference/android/view/SubMenu)   | ` `[addSubMenu](https://developer.android.com/reference/android/view/Menu#addSubMenu(int,%20int,%20int,%20java.lang.CharSequence))`(int groupId, int itemId, int order, `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` title) ` Add a new sub-menu to the menu.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ` abstract `[SubMenu](https://developer.android.com/reference/android/view/SubMenu)   | ` `[addSubMenu](https://developer.android.com/reference/android/view/Menu#addSubMenu(int))`(int titleRes) ` Add a new sub-menu to the menu.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ` abstract void`                                                                      | ` `[clear](https://developer.android.com/reference/android/view/Menu#clear())`() ` Remove all existing items from the menu, leaving it empty as if it had just been created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` abstract void`                                                                      | ` `[close](https://developer.android.com/reference/android/view/Menu#close())`() ` Closes the menu, if open.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` abstract `[MenuItem](https://developer.android.com/reference/android/view/MenuItem) | ` `[findItem](https://developer.android.com/reference/android/view/Menu#findItem(int))`(int id) ` Return the menu item with a particular identifier.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | ` abstract `[MenuItem](https://developer.android.com/reference/android/view/MenuItem) | ` `[getItem](https://developer.android.com/reference/android/view/Menu#getItem(int))`(int index) ` Gets the menu item at the given index.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` abstract boolean`                                                                   | ` `[hasVisibleItems](https://developer.android.com/reference/android/view/Menu#hasVisibleItems())`() ` Return whether the menu currently has item items that are visible.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` abstract boolean`                                                                   | ` `[isShortcutKey](https://developer.android.com/reference/android/view/Menu#isShortcutKey(int,%20android.view.KeyEvent))`(int keyCode, `[KeyEvent](https://developer.android.com/reference/android/view/KeyEvent)` event) ` Is a keypress one of the defined shortcut keys for this window.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` abstract boolean`                                                                   | ` `[performIdentifierAction](https://developer.android.com/reference/android/view/Menu#performIdentifierAction(int,%20int))`(int id, int flags) ` Execute the menu item action associated with the given menu identifier.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` abstract boolean`                                                                   | ` `[performShortcut](https://developer.android.com/reference/android/view/Menu#performShortcut(int,%20android.view.KeyEvent,%20int))`(int keyCode, `[KeyEvent](https://developer.android.com/reference/android/view/KeyEvent)` event, int flags) ` Execute the menu item action associated with the given shortcut character.                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | ` abstract void`                                                                      | ` `[removeGroup](https://developer.android.com/reference/android/view/Menu#removeGroup(int))`(int groupId) ` Remove all items in the given group.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ` abstract void`                                                                      | ` `[removeItem](https://developer.android.com/reference/android/view/Menu#removeItem(int))`(int id) ` Remove the item with the given identifier.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` abstract void`                                                                      | ` `[setGroupCheckable](https://developer.android.com/reference/android/view/Menu#setGroupCheckable(int,%20boolean,%20boolean))`(int group, boolean checkable, boolean exclusive) ` Control whether a particular group of items can show a check mark.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | | ` default void`                                                                       | ` `[setGroupDividerEnabled](https://developer.android.com/reference/android/view/Menu#setGroupDividerEnabled(boolean))`(boolean groupDividerEnabled) ` Enable or disable the group dividers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` abstract void`                                                                      | ` `[setGroupEnabled](https://developer.android.com/reference/android/view/Menu#setGroupEnabled(int,%20boolean))`(int group, boolean enabled) ` Enable or disable all menu items that are in the given group.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` abstract void`                                                                      | ` `[setGroupVisible](https://developer.android.com/reference/android/view/Menu#setGroupVisible(int,%20boolean))`(int group, boolean visible) ` Show or hide all menu items that are in the given group.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` abstract void`                                                                      | ` `[setQwertyMode](https://developer.android.com/reference/android/view/Menu#setQwertyMode(boolean))`(boolean isQwerty) ` Control whether the menu should be running in qwerty mode (alphabetic shortcuts) or 12-key mode (numeric shortcuts).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` abstract int`                                                                       | ` `[size](https://developer.android.com/reference/android/view/Menu#size())`() ` Get the number of items in the menu.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | ||

## Public methods

### clearHeader

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void clearHeader ()
```

Clears the header of the submenu.

<br />

### getItem

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract MenuItem getItem ()
```

Gets the[MenuItem](https://developer.android.com/reference/android/view/MenuItem)that represents this submenu in the parent menu. Use this for setting additional item attributes.

<br />

|                                                                                                Returns                                                                                                ||
|---------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| [MenuItem](https://developer.android.com/reference/android/view/MenuItem) | The[MenuItem](https://developer.android.com/reference/android/view/MenuItem)that launches the submenu when invoked. <br /> |

### setHeaderIcon

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract SubMenu setHeaderIcon (int iconRes)
```

Sets the submenu header's icon to the icon given in<var translate="no">iconRes</var>resource id.

<br />

|                             Parameters                              ||
|-----------|----------------------------------------------------------|
| `iconRes` | `int`: The resource identifier used for the icon. <br /> |

|                                                              Returns                                                              ||
|-------------------------------------------------------------------------|----------------------------------------------------------|
| [SubMenu](https://developer.android.com/reference/android/view/SubMenu) | This SubMenu so additional setters can be called. <br /> |

### setHeaderIcon

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract SubMenu setHeaderIcon (Drawable icon)
```

Sets the submenu header's icon to the icon given in<var translate="no">icon</var>[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable).

<br />

|                                                               Parameters                                                               ||
|--------|--------------------------------------------------------------------------------------------------------------------------------|
| `icon` | `Drawable`: The[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable)used for the icon. <br /> |

|                                                              Returns                                                              ||
|-------------------------------------------------------------------------|----------------------------------------------------------|
| [SubMenu](https://developer.android.com/reference/android/view/SubMenu) | This SubMenu so additional setters can be called. <br /> |

### setHeaderTitle

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract SubMenu setHeaderTitle (int titleRes)
```

Sets the submenu header's title to the title given in<var translate="no">titleRes</var>resource identifier.

<br />

|                                  Parameters                                  ||
|------------|------------------------------------------------------------------|
| `titleRes` | `int`: The string resource identifier used for the title. <br /> |

|                                                              Returns                                                              ||
|-------------------------------------------------------------------------|----------------------------------------------------------|
| [SubMenu](https://developer.android.com/reference/android/view/SubMenu) | This SubMenu so additional setters can be called. <br /> |

### setHeaderTitle

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract SubMenu setHeaderTitle (CharSequence title)
```

Sets the submenu header's title to the title given in<var translate="no">title</var>.

<br />

|                                 Parameters                                 ||
|---------|-------------------------------------------------------------------|
| `title` | `CharSequence`: The character sequence used for the title. <br /> |

|                                                              Returns                                                              ||
|-------------------------------------------------------------------------|----------------------------------------------------------|
| [SubMenu](https://developer.android.com/reference/android/view/SubMenu) | This SubMenu so additional setters can be called. <br /> |

### setHeaderView

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract SubMenu setHeaderView (View view)
```

Sets the header of the submenu to the[View](https://developer.android.com/reference/android/view/View)given in<var translate="no">view</var>. This replaces the header title and icon (and those replace this).

<br />

|                                                   Parameters                                                    ||
|--------|---------------------------------------------------------------------------------------------------------|
| `view` | `View`: The[View](https://developer.android.com/reference/android/view/View)used for the header. <br /> |

|                                                              Returns                                                              ||
|-------------------------------------------------------------------------|----------------------------------------------------------|
| [SubMenu](https://developer.android.com/reference/android/view/SubMenu) | This SubMenu so additional setters can be called. <br /> |

### setIcon

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract SubMenu setIcon (Drawable icon)
```

Change the icon associated with this submenu's item in its parent menu.

<br />

|                                Parameters                                ||
|--------|------------------------------------------------------------------|
| `icon` | `Drawable`: The new icon (as a Drawable) to be displayed. <br /> |

|                                                              Returns                                                              ||
|-------------------------------------------------------------------------|----------------------------------------------------------|
| [SubMenu](https://developer.android.com/reference/android/view/SubMenu) | This SubMenu so additional setters can be called. <br /> |

**See also:**

- [MenuItem.setIcon(Drawable)](https://developer.android.com/reference/android/view/MenuItem#setIcon(android.graphics.drawable.Drawable))  

### setIcon

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract SubMenu setIcon (int iconRes)
```

Change the icon associated with this submenu's item in its parent menu.

<br />

|                                Parameters                                 ||
|-----------|----------------------------------------------------------------|
| `iconRes` | `int`: The new icon (as a resource ID) to be displayed. <br /> |

|                                                              Returns                                                              ||
|-------------------------------------------------------------------------|----------------------------------------------------------|
| [SubMenu](https://developer.android.com/reference/android/view/SubMenu) | This SubMenu so additional setters can be called. <br /> |

**See also:**

- [MenuItem.setIcon(int)](https://developer.android.com/reference/android/view/MenuItem#setIcon(int))