FileDocCategorySizeDatePackage
ContextMenu.javaAPI DocAndroid 5.1 API3394Thu Mar 12 22:22:10 GMT 2015android.view

ContextMenu

public interface ContextMenu implements Menu
Extension of {@link 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 {@link Activity#registerForContextMenu} and override {@link Activity#onCreateContextMenu}.

Developer Guides

For information about creating menus, read the Menus developer guide.

Fields Summary
Constructors Summary
Methods Summary
public voidclearHeader()
Clears the header of the context menu.

public android.view.ContextMenusetHeaderIcon(int iconRes)
Sets the context menu header's icon to the icon given in iconRes resource id.

param
iconRes The resource identifier used for the icon.
return
This ContextMenu so additional setters can be called.

public android.view.ContextMenusetHeaderIcon(android.graphics.drawable.Drawable icon)
Sets the context menu header's icon to the icon given in icon {@link Drawable}.

param
icon The {@link Drawable} used for the icon.
return
This ContextMenu so additional setters can be called.

public android.view.ContextMenusetHeaderTitle(int titleRes)
Sets the context menu header's title to the title given in titleRes resource identifier.

param
titleRes The string resource identifier used for the title.
return
This ContextMenu so additional setters can be called.

public android.view.ContextMenusetHeaderTitle(java.lang.CharSequence title)
Sets the context menu header's title to the title given in title.

param
title The character sequence used for the title.
return
This ContextMenu so additional setters can be called.

public android.view.ContextMenusetHeaderView(View view)
Sets the header of the context menu to the {@link View} given in view. This replaces the header title and icon (and those replace this).

param
view The {@link View} used for the header.
return
This ContextMenu so additional setters can be called.