次の方法で共有


SliceProvider.OnSlicePinned(Uri) Method

Definition

Called to inform an app that a slice has been pinned.

[Android.Runtime.Register("onSlicePinned", "(Landroid/net/Uri;)V", "GetOnSlicePinned_Landroid_net_Uri_Handler", ApiSince=28)]
public virtual void OnSlicePinned (Android.Net.Uri? sliceUri);
[<Android.Runtime.Register("onSlicePinned", "(Landroid/net/Uri;)V", "GetOnSlicePinned_Landroid_net_Uri_Handler", ApiSince=28)>]
abstract member OnSlicePinned : Android.Net.Uri -> unit
override this.OnSlicePinned : Android.Net.Uri -> unit

Parameters

sliceUri
Uri

The uri of the slice being unpinned.

Attributes

Remarks

Called to inform an app that a slice has been pinned.

Pinning is a way that slice hosts use to notify apps of which slices they care about updates for. When a slice is pinned the content is expected to be relatively fresh and kept up to date.

Being pinned does not provide any escalated privileges for the slice provider. So apps should do things such as turn on syncing or schedule a job in response to a onSlicePinned.

Pinned state is not persisted through a reboot, and apps can expect a new call to onSlicePinned for any slices that should remain pinned after a reboot occurs.

Java documentation for android.app.slice.SliceProvider.onSlicePinned(android.net.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