ContextMenu
interface ContextMenu : Menu
| android.view.ContextMenu |
Extension of Menu for context menus providing functionality to modify the header of the context menu.
Context menus do not support item shortcuts and item icons.
To show a context menu on long click, most clients will want to call Activity.registerForContextMenu and override Activity.onCreateContextMenu.
Summary
| Nested classes | |
|---|---|
| abstract |
Additional information regarding the creation of the context menu. |
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| abstract Unit |
Clears the header of the context menu. |
| abstract ContextMenu! |
setHeaderIcon(icon: Drawable!)Sets the context menu header's icon to the icon given in icon |
| abstract ContextMenu! |
setHeaderIcon(iconRes: Int)Sets the context menu header's icon to the icon given in iconRes resource id. |
| abstract ContextMenu! |
setHeaderTitle(titleRes: Int)Sets the context menu header's title to the title given in titleRes resource identifier. |
| abstract ContextMenu! |
setHeaderTitle(title: CharSequence!)Sets the context menu header's title to the title given in title. |
| abstract ContextMenu! |
setHeaderView(view: View!)Sets the header of the context menu to the |
| Inherited functions | |
|---|---|
Public methods
clearHeader
abstract fun clearHeader(): Unit
Clears the header of the context menu.
setHeaderIcon
abstract fun setHeaderIcon(icon: Drawable!): ContextMenu!
Sets the context menu header's icon to the icon given in icon Drawable.
| Parameters | |
|---|---|
icon |
Drawable!: The Drawable used for the icon. |
| Return | |
|---|---|
ContextMenu! |
This ContextMenu so additional setters can be called. |
setHeaderIcon
abstract fun setHeaderIcon(iconRes: Int): ContextMenu!
Sets the context menu header's icon to the icon given in iconRes resource id.
| Parameters | |
|---|---|
iconRes |
Int: The resource identifier used for the icon. |
| Return | |
|---|---|
ContextMenu! |
This ContextMenu so additional setters can be called. |
setHeaderTitle
abstract fun setHeaderTitle(titleRes: Int): ContextMenu!
Sets the context menu header's title to the title given in titleRes resource identifier.
| Parameters | |
|---|---|
titleRes |
Int: The string resource identifier used for the title. |
| Return | |
|---|---|
ContextMenu! |
This ContextMenu so additional setters can be called. |
setHeaderTitle
abstract fun setHeaderTitle(title: CharSequence!): ContextMenu!
Sets the context menu header's title to the title given in title.
| Parameters | |
|---|---|
title |
CharSequence!: The character sequence used for the title. |
| Return | |
|---|---|
ContextMenu! |
This ContextMenu so additional setters can be called. |
setHeaderView
abstract fun setHeaderView(view: View!): ContextMenu!
Sets the header of the context menu 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 | |
|---|---|
ContextMenu! |
This ContextMenu so additional setters can be called. |