Android
android.view
public interface

android.view.ContextMenu

android.view.ContextMenu Menu

Extension of Menu for context menus providing functionality to modify the header of the context menu.

Context menus do not support item shortcuts, item icons, and sub menus.

To show a context menu on long click, most clients will want to call registerForContextMenu(View) and override onCreateContextMenu(ContextMenu, View, ContextMenu.ContextMenuInfo).

Nested Classes
ContextMenu.ContextMenuInfo Additional information regarding the creation of the context menu. 

Summary

Constants inherited from interface android.view.Menu

Public Methods

          void  clearHeader()
Clears the header of the context menu.
          ContextMenu  setHeaderIcon(Drawable icon)
Sets the context menu header's icon to the icon given in icon Drawable.
          ContextMenu  setHeaderIcon(int iconRes)
Sets the context menu header's icon to the icon given in iconRes resource id.
          ContextMenu  setHeaderTitle(int titleRes)
Sets the context menu header's title to the title given in titleRes resource identifier.
          ContextMenu  setHeaderTitle(CharSequence title)
Sets the context menu header's title to the title given in title.
          ContextMenu  setHeaderView(View view)
Sets the header of the context menu to the View given in view.
Methods inherited from interface android.view.Menu

Details

Public Methods

public void clearHeader()

Clears the header of the context menu.

public ContextMenu setHeaderIcon(Drawable icon)

Sets the context menu header's icon to the icon given in icon Drawable.

Parameters

icon The Drawable used for the icon.

Returns

  • This ContextMenu so additional setters can be called.

public ContextMenu setHeaderIcon(int iconRes)

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

Parameters

iconRes The resource identifier used for the icon.

Returns

  • This ContextMenu so additional setters can be called.

public ContextMenu setHeaderTitle(int titleRes)

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

Parameters

titleRes The string resource identifier used for the title.

Returns

  • This ContextMenu so additional setters can be called.

public ContextMenu setHeaderTitle(CharSequence title)

Sets the context menu header's title to the title given in title.

Parameters

title The character sequence used for the title.

Returns

  • This ContextMenu so additional setters can be called.

public ContextMenu setHeaderView(View view)

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 The View used for the header.

Returns

  • This ContextMenu so additional setters can be called.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56