次の方法で共有


Activity.RegisterForContextMenu(View) Method

Definition

Registers a context menu to be shown for the given view (multiple views can show the context menu).

[Android.Runtime.Register("registerForContextMenu", "(Landroid/view/View;)V", "GetRegisterForContextMenu_Landroid_view_View_Handler")]
public virtual void RegisterForContextMenu (Android.Views.View? view);
[<Android.Runtime.Register("registerForContextMenu", "(Landroid/view/View;)V", "GetRegisterForContextMenu_Landroid_view_View_Handler")>]
abstract member RegisterForContextMenu : Android.Views.View -> unit
override this.RegisterForContextMenu : Android.Views.View -> unit

Parameters

view
View

The view that should show a context menu.

Attributes

Remarks

Registers a context menu to be shown for the given view (multiple views can show the context menu). This method will set the OnCreateContextMenuListener on the view to this activity, so #onCreateContextMenu(ContextMenu, View, ContextMenuInfo) will be called when it is time to show the context menu.

Java documentation for android.app.Activity.registerForContextMenu(android.view.View).

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.

Applies to

See also