Partager via


ShareActionProvider.IOnShareTargetSelectedListener.OnShareTargetSelected Method

Definition

Called when a share target has been selected.

[Android.Runtime.Register("onShareTargetSelected", "(Landroid/widget/ShareActionProvider;Landroid/content/Intent;)Z", "GetOnShareTargetSelected_Landroid_widget_ShareActionProvider_Landroid_content_Intent_Handler:Android.Widget.ShareActionProvider/IOnShareTargetSelectedListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool OnShareTargetSelected (Android.Widget.ShareActionProvider? source, Android.Content.Intent? intent);
[<Android.Runtime.Register("onShareTargetSelected", "(Landroid/widget/ShareActionProvider;Landroid/content/Intent;)Z", "GetOnShareTargetSelected_Landroid_widget_ShareActionProvider_Landroid_content_Intent_Handler:Android.Widget.ShareActionProvider/IOnShareTargetSelectedListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OnShareTargetSelected : Android.Widget.ShareActionProvider * Android.Content.Intent -> bool

Parameters

source
ShareActionProvider

The source of the notification.

intent
Intent

The intent for launching the chosen share target.

Returns

The return result is ignored. Always return false for consistency.

Attributes

Remarks

Called when a share target has been selected. The client can decide whether to perform some action before the sharing is actually performed.

<strong>Note:</strong> Modifying the intent is not permitted and any changes to the latter will be ignored.

<strong>Note:</strong> You should <strong>not</strong> handle the intent here. This callback aims to notify the client that a sharing is being performed, so the client can update the UI if necessary.

Java documentation for android.widget.ShareActionProvider.OnShareTargetSelectedListener.onShareTargetSelected(android.widget.ShareActionProvider, android.content.Intent).

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