Sdílet prostřednictvím


Intent.ExtraChooserAdditionalContentUri Field

Definition

Optional argument used to provide a ContentProviderUri to an #ACTION_CHOOSER Intent which allows additional toggleable items to be included in the sharing UI.

[Android.Runtime.Register("EXTRA_CHOOSER_ADDITIONAL_CONTENT_URI", ApiSince=35)]
public const string ExtraChooserAdditionalContentUri;
[<Android.Runtime.Register("EXTRA_CHOOSER_ADDITIONAL_CONTENT_URI", ApiSince=35)>]
val mutable ExtraChooserAdditionalContentUri : string

Field Value

Implements

Attributes

Remarks

Optional argument used to provide a ContentProviderUri to an #ACTION_CHOOSER Intent which allows additional toggleable items to be included in the sharing UI.

For example, this could be used to show photos being shared in the context of the user's entire photo roll, with the option to change the set of photos being shared.

When this is provided in an #ACTION_CHOOSER Intent with an #ACTION_SEND or #ACTION_SEND_MULTIPLE target Intent, the sharesheet will query (see ContentProvider#query(Uri, String[], Bundle, CancellationSignal)) this URI to retrieve a set of additional items available for selection. The set of items returned by the content provider is expected to contain all the items from the #EXTRA_STREAM argument, in their relative order, which will be marked as selected. The URI's authority must be different from any shared items URI provided in #EXTRA_STREAM or returned by the provider.

The Bundle argument of the ContentProvider#query(Uri, String[], Bundle, CancellationSignal) method will contains the original intent Chooser has been launched with under the #EXTRA_INTENT key as a context for the current sharing session. The returned android.database.Cursor should contain android.service.chooser.AdditionalContentContract.Columns#URI column for the item URI and, optionally, AdditionalContentContract.CursorExtraKeys#POSITION extra that specifies the cursor starting position; the item at this position is expected to match the item specified by #EXTRA_CHOOSER_FOCUSED_ITEM_POSITION.

When the user makes a selection change, ContentProvider#call(String, String, Bundle) method will be invoked with the "method" argument set to android.service.chooser.AdditionalContentContract.MethodNames#ON_SELECTION_CHANGED, the "arg" argument set to this argument's value, and the "extras" Bundle argument containing #EXTRA_INTENT key containing the original intent Chooser has been launched with but with the modified target intent --Chooser will modify the target intent according to the selection changes made by the user. Applications may implement this method to change any of the following Chooser arguments by returning new values in the result bundle: #EXTRA_CHOOSER_TARGETS, #EXTRA_ALTERNATE_INTENTS, #EXTRA_CHOOSER_CUSTOM_ACTIONS, #EXTRA_CHOOSER_MODIFY_SHARE_ACTION, #EXTRA_METADATA_TEXT, #EXTRA_CHOOSER_REFINEMENT_INTENT_SENDER, #EXTRA_CHOOSER_RESULT_INTENT_SENDER.

Java documentation for android.content.Intent.EXTRA_CHOOSER_ADDITIONAL_CONTENT_URI.

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