Share via


SliceManager.MapIntentToUri(Intent) Method

Definition

Turns a slice intent into a slice uri.

[Android.Runtime.Register("mapIntentToUri", "(Landroid/content/Intent;)Landroid/net/Uri;", "GetMapIntentToUri_Landroid_content_Intent_Handler", ApiSince=28)]
public virtual Android.Net.Uri? MapIntentToUri (Android.Content.Intent intent);
[<Android.Runtime.Register("mapIntentToUri", "(Landroid/content/Intent;)Landroid/net/Uri;", "GetMapIntentToUri_Landroid_content_Intent_Handler", ApiSince=28)>]
abstract member MapIntentToUri : Android.Content.Intent -> Android.Net.Uri
override this.MapIntentToUri : Android.Content.Intent -> Android.Net.Uri

Parameters

intent
Intent

The intent associated with a slice.

Returns

Uri

The Slice Uri provided by the app or null if none exists.

Attributes

Remarks

Turns a slice intent into a slice uri. Expects an explicit intent.

This goes through a several stage resolution process to determine if any slice can represent this intent. <ol> <li> If the intent contains data that ContentResolver#getType is SliceProvider#SLICE_TYPE then the data will be returned.</li> <li>If the intent explicitly points at an activity, and that activity has meta-data for key #SLICE_METADATA_KEY, then the Uri specified there will be returned.</li> <li>Lastly, if the intent with #CATEGORY_SLICE added resolves to a provider, then the provider will be asked to SliceProvider#onMapIntentToUri and that result will be returned.</li> <li>If no slice is found, then null is returned.</li> </ol>

Java documentation for android.app.slice.SliceManager.mapIntentToUri(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