Activity.OnCreateContextMenu Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Called when a context menu for the view is about to be shown.
[Android.Runtime.Register("onCreateContextMenu", "(Landroid/view/ContextMenu;Landroid/view/View;Landroid/view/ContextMenu$ContextMenuInfo;)V", "GetOnCreateContextMenu_Landroid_view_ContextMenu_Landroid_view_View_Landroid_view_ContextMenu_ContextMenuInfo_Handler")]
public virtual void OnCreateContextMenu(Android.Views.IContextMenu? menu, Android.Views.View? v, Android.Views.IContextMenuContextMenuInfo? menuInfo);
[<Android.Runtime.Register("onCreateContextMenu", "(Landroid/view/ContextMenu;Landroid/view/View;Landroid/view/ContextMenu$ContextMenuInfo;)V", "GetOnCreateContextMenu_Landroid_view_ContextMenu_Landroid_view_View_Landroid_view_ContextMenu_ContextMenuInfo_Handler")>]
abstract member OnCreateContextMenu : Android.Views.IContextMenu * Android.Views.View * Android.Views.IContextMenuContextMenuInfo -> unit
override this.OnCreateContextMenu : Android.Views.IContextMenu * Android.Views.View * Android.Views.IContextMenuContextMenuInfo -> unit
Parameters
- menu
- IContextMenu
ContextMenu: The context menu that is being built
- v
- View
View: The view for which the context menu is being built
- menuInfo
- IContextMenuContextMenuInfo
ContextMenu.ContextMenuInfo: Extra information about the item for which the context menu should be shown. This information will vary depending on the class of v.
Implements
- Attributes
Remarks
Called when a context menu for the view is about to be shown. Unlike onCreateOptionsMenu(Menu), this will be called every time the context menu is about to be shown and should be populated for the view (or item inside the view for AdapterView subclasses, this can be found in the menuInfo)). Use onContextItemSelected(android.view.MenuItem) to know when an item has been selected. It is not safe to hold onto the context menu after this method returns.
Android reference for android.app.Activity.onCreateContextMenu.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.