Share via


Instrumentation.InvokeContextMenuAction Method

Definition

Show the context menu for the currently focused view and executes a particular context menu item.

[Android.Runtime.Register("invokeContextMenuAction", "(Landroid/app/Activity;II)Z", "GetInvokeContextMenuAction_Landroid_app_Activity_IIHandler")]
public virtual bool InvokeContextMenuAction (Android.App.Activity? targetActivity, int id, Android.Views.MenuPerformFlags flag);
[<Android.Runtime.Register("invokeContextMenuAction", "(Landroid/app/Activity;II)Z", "GetInvokeContextMenuAction_Landroid_app_Activity_IIHandler")>]
abstract member InvokeContextMenuAction : Android.App.Activity * int * Android.Views.MenuPerformFlags -> bool
override this.InvokeContextMenuAction : Android.App.Activity * int * Android.Views.MenuPerformFlags -> bool

Parameters

targetActivity
Activity

The activity in question.

id
Int32

The identifier associated with the context menu item.

flag
MenuPerformFlags

Additional flags, if any.

Returns

Whether the invocation was successful (for example, it could be false if item is disabled).

Attributes

Remarks

Show the context menu for the currently focused view and executes a particular context menu item.

Java documentation for android.app.Instrumentation.invokeContextMenuAction(android.app.Activity, int, int).

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