Slice

public final class Slice
extends Object implements VersionedParcelable, VersionedParcelable

java.lang.Object
   ↳ androidx.slice.Slice


A slice is a piece of app content and actions that can be surfaced outside of the app. A slice is identified by a Uri and served via a SliceProvider.

Slices are constructed using TemplateSliceBuilders in a tree structure that provides the OS some information about how the content should be displayed.

Summary

Constants

String EXTRA_SELECTION

Key to retrieve an extra added to an intent when an item in a selection is selected.

Public methods

List<String> getHints()
List<SliceItem> getItems()
Uri getUri()
String toString()

Inherited methods

Constants

EXTRA_SELECTION

public static final String EXTRA_SELECTION

Key to retrieve an extra added to an intent when an item in a selection is selected.

Constant Value: "android.app.slice.extra.SELECTION"

Public methods

getHints

public List<String> getHints ()

Returns
List<String> All hints associated with this Slice.

getItems

public List<SliceItem> getItems ()

Returns
List<SliceItem> All child SliceItems that this Slice contains.

getUri

public Uri getUri ()

Returns
Uri The Uri that this Slice represents.

toString

public String toString ()

Returns
String A string representation of this slice.