public final class SliceItem
extends Object implements VersionedParcelable

   ↳ androidx.slice.SliceItem

A SliceItem is a single unit in the tree structure of a Slice.

A SliceItem a piece of content and some hints about what that content means or how it should be displayed. The types of content can be:

The hints that a SliceItem are a set of strings which annotate the content. The hints that are guaranteed to be understood by the system are defined on Slice.


Public methods

static ParcelableSpan createSensitiveSpan()

Creates a span object that identifies content that should be redacted when acquired using getRedactedText().

void fireAction(Context context, Intent i)

Trigger the action on this SliceItem.

PendingIntent getAction()
String getFormat()

Get the format of this SliceItem.

List<String> getHints()

Gets all hints associated with this SliceItem.

IconCompat getIcon()
int getInt()
long getLong()
CharSequence getRedactedText()

Get the same content as getText() except with content that should be excluded from persistent logs because it was tagged with createSensitiveSpan().

Slice getSlice()
String getSubType()

Get the sub-type of this SliceItem.

CharSequence getText()
boolean hasHint(String hint)
void onPostParceling()

Called immediately after this object has been deserialized, can be used to handle any custom fields that cannot be easily annotated.

void onPreParceling(boolean isStream)

Called immediately before this object is going to be serialized, can be used to handl