Added in API level 1

SubMenu


interface SubMenu : Menu
android.view.SubMenu

Subclass of Menu for sub menus.

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

Summary

Inherited constants
Public methods
abstract Unit

Clears the header of the submenu.

abstract MenuItem!

Gets the MenuItem that represents this submenu in the parent menu.

abstract SubMenu!
setHeaderIcon(iconRes: Int)

Sets the submenu header's icon to the icon given in iconRes resource id.

abstract SubMenu!

Sets the submenu header's icon to the icon given in icon Drawable.

abstract SubMenu!
setHeaderTitle(titleRes: Int)

Sets the submenu header's title to the title given in titleRes resource identifier.

abstract SubMenu!

Sets the submenu header's title to the title given in title.

abstract SubMenu!

Sets the header of the submenu to the View given in view.

abstract SubMenu!
setIcon(iconRes: Int)

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

abstract SubMenu!
setIcon(icon: Drawable!)

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

Inherited functions

Public methods

clearHeader

Added in API level 1
abstract fun clearHeader(): Unit

Clears the header of the submenu.

getItem

Added in API level 1
abstract fun getItem(): MenuItem!

Gets the MenuItem that represents this submenu in the parent menu. Use this for setting additional item attributes.

Return
MenuItem! The MenuItem that launches the submenu when invoked.

setHeaderIcon

Added in API level 1
abstract fun setHeaderIcon(iconRes: Int): SubMenu!

Sets the submenu header's icon to the icon given in iconRes resource id.

Parameters
iconRes Int: The resource identifier used for the icon.
Return
SubMenu! This SubMenu so additional setters can be called.

setHeaderIcon

Added in API level 1
abstract fun setHeaderIcon(icon: Drawable!): SubMenu!

Sets the submenu header's icon to the icon given in icon Drawable.

Parameters
icon Drawable!: The Drawable used for the icon.
Return
SubMenu! This SubMenu so additional setters can be called.

setHeaderTitle

Added in API level 1
abstract fun setHeaderTitle(titleRes: Int): SubMenu!

Sets the submenu header's title to the title given in titleRes resource identifier.

Parameters
titleRes Int: The string resource identifier used for the title.
Return
SubMenu! This SubMenu so additional setters can be called.

setHeaderTitle

Added in API level 1
abstract fun setHeaderTitle(title: CharSequence!): SubMenu!

Sets the submenu header's title to the title given in title.

Parameters
title CharSequence!: The character sequence used for the title.
Return
SubMenu! This SubMenu so additional setters can be called.

setHeaderView

Added in API level 1
abstract fun setHeaderView(view: View!): SubMenu!

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 View!: The View used for the header.
Return
SubMenu! This SubMenu so additional setters can be called.

setIcon

Added in API level 1
abstract fun setIcon(iconRes: Int): SubMenu!

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

Parameters
iconRes Int: The new icon (as a resource ID) to be displayed.
Return
SubMenu! This SubMenu so additional setters can be called.

setIcon

Added in API level 1
abstract fun setIcon(icon: Drawable!): SubMenu!

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

Parameters
icon Drawable!: The new icon (as a Drawable) to be displayed.
Return
SubMenu! This SubMenu so additional setters can be called.