Language

Fragment.UnregisterForContextMenu(View) Method

Definition

Prevents a context menu to be shown for the given view.

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

Parameters

view
View

The view that should stop showing a context menu.

Attributes

Remarks

Prevents a context menu to be shown for the given view. This method will remove the OnCreateContextMenuListener on the view.

See also:

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-03 UTC.

Android reference for android.app.Fragment.unregisterForContextMenu.

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