Language

VisualizerViewAction.Attach Method

Definition

Attaches the specified short-click and/or long-click actions to the target view inside a RemoteViews hierarchy.

[Android.Runtime.Register("attach", "(Landroid/content/Context;Landroid/widget/RemoteViews;ILandroid/service/personalcontext/embedded/VisualizerViewAction;Landroid/service/personalcontext/embedded/VisualizerViewAction;)V", "", ApiSince=37)]
public static void Attach(Android.Content.Context context, Android.Widget.RemoteViews remoteViews, int viewId, Android.Service.PersonalContext.Embedded.VisualizerViewAction? onClickAction, Android.Service.PersonalContext.Embedded.VisualizerViewAction? onLongClickAction);
[<Android.Runtime.Register("attach", "(Landroid/content/Context;Landroid/widget/RemoteViews;ILandroid/service/personalcontext/embedded/VisualizerViewAction;Landroid/service/personalcontext/embedded/VisualizerViewAction;)V", "", ApiSince=37)>]
static member Attach : Android.Content.Context * Android.Widget.RemoteViews * int * Android.Service.PersonalContext.Embedded.VisualizerViewAction * Android.Service.PersonalContext.Embedded.VisualizerViewAction -> unit

Parameters

context
Context

The Context used to create the underlying PendingIntent.

remoteViews
RemoteViews

The RemoteViews hierarchy containing the target view.

viewId
Int32

The resource ID of the view that should trigger these actions when clicked.

onClickAction
VisualizerViewAction

The action to execute when the target view is clicked, or null if none.

onLongClickAction
VisualizerViewAction

The action to execute when the target view is long-pressed, or null if none.

Attributes

Remarks

At least one of the two actions must be supplied. The method packages the actions in a broadcast pending intent and assigns it to the view's click handler, then cancels the pending intent to release its resources. The personal context framework handles the packaged actions rather than sending that broadcast.

Applies to