Share via


SliceProvider.OnBindSlice(Uri, ICollection<SliceSpec>) Method

Definition

Implemented to create a slice.

[Android.Runtime.Register("onBindSlice", "(Landroid/net/Uri;Ljava/util/Set;)Landroid/app/slice/Slice;", "GetOnBindSlice_Landroid_net_Uri_Ljava_util_Set_Handler", ApiSince=28)]
public virtual Android.App.Slices.Slice? OnBindSlice (Android.Net.Uri? sliceUri, System.Collections.Generic.ICollection<Android.App.Slices.SliceSpec>? supportedSpecs);
[<Android.Runtime.Register("onBindSlice", "(Landroid/net/Uri;Ljava/util/Set;)Landroid/app/slice/Slice;", "GetOnBindSlice_Landroid_net_Uri_Ljava_util_Set_Handler", ApiSince=28)>]
abstract member OnBindSlice : Android.Net.Uri * System.Collections.Generic.ICollection<Android.App.Slices.SliceSpec> -> Android.App.Slices.Slice
override this.OnBindSlice : Android.Net.Uri * System.Collections.Generic.ICollection<Android.App.Slices.SliceSpec> -> Android.App.Slices.Slice

Parameters

sliceUri
Uri

Uri to bind.

supportedSpecs
ICollection<SliceSpec>

List of supported specs.

Returns

Attributes

Remarks

Implemented to create a slice.

onBindSlice should return as quickly as possible so that the UI tied to this slice can be responsive. No network or other IO will be allowed during onBindSlice. Any loading that needs to be done should happen in the background with a call to ContentResolver#notifyChange(Uri, ContentObserver) when the app is ready to provide the complete data in onBindSlice.

The slice returned should have a spec that is compatible with one of the supported specs.

Java documentation for android.app.slice.SliceProvider.onBindSlice(android.net.Uri, java.util.Set<android.app.slice.SliceSpec>).

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