Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/app/slice/SliceItem#constants) \| [Inherited Constants](https://developer.android.com/reference/android/app/slice/SliceItem#inhconstants) \| [Fields](https://developer.android.com/reference/android/app/slice/SliceItem#lfields) \| [Methods](https://developer.android.com/reference/android/app/slice/SliceItem#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/slice/SliceItem#inhmethods)

# SliceItem

*** ** * ** ***

` public final class SliceItem `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.slice.SliceItem |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 35.**   

Slice framework has been deprecated, it will not receive any updates from `https://developer.android.com/` and forward. If you are looking for a framework that sends displayable data from one app to another, consider using `https://developer.android.com/reference/android/app/appsearch/AppSearchManager`.

A SliceItem is a single unit in the tree structure of a `https://developer.android.com/reference/android/app/slice/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:
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_SLICE`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_TEXT`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_IMAGE`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_ACTION`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_INT`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_LONG`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_REMOTE_INPUT`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_BUNDLE`
The hints that a `https://developer.android.com/reference/android/app/slice/SliceItem` are a set of strings which annotate the content. The hints that are guaranteed to be understood by the system are defined on `https://developer.android.com/reference/android/app/slice/Slice`.

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_ACTION` A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains a `https://developer.android.com/reference/android/app/PendingIntent` Note: Actions contain 2 pieces of data, In addition to the pending intent, the item contains a `https://developer.android.com/reference/android/app/slice/Slice` that the action applies to. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_BUNDLE` A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains a `https://developer.android.com/reference/android/os/Bundle`. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_IMAGE` A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains an `https://developer.android.com/reference/android/graphics/drawable/Icon` |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_INT` A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains an int. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_LONG` A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains a long. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_REMOTE_INPUT` A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains a `https://developer.android.com/reference/android/app/RemoteInput`. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_SLICE` A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains a `https://developer.android.com/reference/android/app/slice/Slice` |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_TEXT` A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains a `https://developer.android.com/reference/java/lang/CharSequence` |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`".

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/app/slice/SliceItem>` | `https://developer.android.com/reference/android/app/slice/SliceItem#CREATOR` <br /> |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/app/slice/SliceItem#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` https://developer.android.com/reference/android/app/PendingIntent` | ` https://developer.android.com/reference/android/app/slice/SliceItem#getAction()() ` |
| ` https://developer.android.com/reference/android/os/Bundle` | ` https://developer.android.com/reference/android/app/slice/SliceItem#getBundle()() ` |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/app/slice/SliceItem#getFormat()() ` Get the format of this SliceItem. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>` | ` https://developer.android.com/reference/android/app/slice/SliceItem#getHints()() ` Gets all hints associated with this SliceItem. |
| ` https://developer.android.com/reference/android/graphics/drawable/Icon` | ` https://developer.android.com/reference/android/app/slice/SliceItem#getIcon()() ` |
| ` int` | ` https://developer.android.com/reference/android/app/slice/SliceItem#getInt()() ` |
| ` long` | ` https://developer.android.com/reference/android/app/slice/SliceItem#getLong()() ` |
| ` https://developer.android.com/reference/android/app/RemoteInput` | ` https://developer.android.com/reference/android/app/slice/SliceItem#getRemoteInput()() ` |
| ` https://developer.android.com/reference/android/app/slice/Slice` | ` https://developer.android.com/reference/android/app/slice/SliceItem#getSlice()() ` |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/app/slice/SliceItem#getSubType()() ` Get the sub-type of this SliceItem. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/app/slice/SliceItem#getText()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/app/slice/SliceItem#hasHint(java.lang.String)(https://developer.android.com/reference/java/lang/String hint) ` |
| ` void` | ` https://developer.android.com/reference/android/app/slice/SliceItem#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Constants

### FORMAT_ACTION

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FORMAT_ACTION
```

A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains a `https://developer.android.com/reference/android/app/PendingIntent` Note: Actions contain 2 pieces of data, In addition to the pending intent, the item contains a `https://developer.android.com/reference/android/app/slice/Slice` that the action applies to.

<br />

Constant Value: "action"

### FORMAT_BUNDLE

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FORMAT_BUNDLE
```

A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains a `https://developer.android.com/reference/android/os/Bundle`.

<br />

Constant Value: "bundle"

### FORMAT_IMAGE

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FORMAT_IMAGE
```

A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains an `https://developer.android.com/reference/android/graphics/drawable/Icon`

<br />

Constant Value: "image"

### FORMAT_INT

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FORMAT_INT
```

A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains an int.

<br />

Constant Value: "int"

### FORMAT_LONG

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FORMAT_LONG
```

A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains a long.

<br />

Constant Value: "long"

### FORMAT_REMOTE_INPUT

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FORMAT_REMOTE_INPUT
```

A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains a `https://developer.android.com/reference/android/app/RemoteInput`.

<br />

Constant Value: "input"

### FORMAT_SLICE

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FORMAT_SLICE
```

A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains a `https://developer.android.com/reference/android/app/slice/Slice`

<br />

Constant Value: "slice"

### FORMAT_TEXT

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FORMAT_TEXT
```

A `https://developer.android.com/reference/android/app/slice/SliceItem` that contains a `https://developer.android.com/reference/java/lang/CharSequence`

<br />

Constant Value: "text"

## Fields

### CREATOR

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<SliceItem> CREATOR
```

<br />

<br />

## Public methods

### describeContents

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`, the return value of this method must include the `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getAction

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PendingIntent getAction ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/PendingIntent` | The pending intent held by this `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_ACTION` SliceItem <br /> |

### getBundle

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Bundle getBundle ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Bundle` | The parcelable held by this `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_BUNDLE` SliceItem <br /> |

### getFormat

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getFormat ()
```

Get the format of this SliceItem.

The format will be one of the following types supported by the platform:
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_SLICE`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_TEXT`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_IMAGE`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_ACTION`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_INT`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_LONG`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_REMOTE_INPUT`
- `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_BUNDLE`

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/slice/SliceItem#getSubType()`

### getHints

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<String> getHints ()
```

Gets all hints associated with this SliceItem.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>` | Array of hints. This value cannot be `null`. Value is one of the following: - `https://developer.android.com/reference/android/app/slice/Slice#HINT_TITLE` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_LIST` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_LIST_ITEM` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_LARGE` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_ACTIONS` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_SELECTED` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_NO_TINT` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_SHORTCUT` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_HORIZONTAL` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_PARTIAL` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_SEE_MORE` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_KEYWORDS` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_ERROR` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_TTL` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_LAST_UPDATED` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_PERMISSION_REQUEST` |

### getIcon

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Icon getIcon ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Icon` | The icon held by this `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_IMAGE` SliceItem <br /> |

### getInt

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getInt ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | The color held by this `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_INT` SliceItem <br /> |

### getLong

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getLong ()
```

<br />

<br />

| Returns ||
|---|---|
| `long` | The long held by this `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_LONG` SliceItem <br /> |

### getRemoteInput

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public RemoteInput getRemoteInput ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/RemoteInput` | The remote input held by this `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_REMOTE_INPUT` SliceItem <br /> |

### getSlice

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Slice getSlice ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/slice/Slice` | The slice held by this `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_ACTION` or `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_SLICE` SliceItem <br /> |

### getSubType

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getSubType ()
```

Get the sub-type of this SliceItem.

Subtypes provide additional information about the type of this information beyond basic interpretations inferred by `https://developer.android.com/reference/android/app/slice/SliceItem#getFormat()`. For example a slice may contain many `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_TEXT` items, but only some of them may be `https://developer.android.com/reference/android/app/slice/Slice#SUBTYPE_MESSAGE`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/slice/SliceItem#getFormat()`

### getText

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CharSequence getText ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | The text held by this `https://developer.android.com/reference/android/app/slice/SliceItem#FORMAT_TEXT` SliceItem <br /> |

### hasHint

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean hasHint (String hint)
```

<br />

<br />

| Parameters ||
|---|---|
| `hint` | `String`: The hint to check for. Value is one of the following: - `https://developer.android.com/reference/android/app/slice/Slice#HINT_TITLE` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_LIST` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_LIST_ITEM` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_LARGE` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_ACTIONS` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_SELECTED` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_NO_TINT` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_SHORTCUT` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_HORIZONTAL` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_PARTIAL` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_SEE_MORE` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_KEYWORDS` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_ERROR` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_TTL` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_LAST_UPDATED` - `https://developer.android.com/reference/android/app/slice/Slice#HINT_PERMISSION_REQUEST` |

| Returns ||
|---|---|
| `boolean` | true if this item contains the given hint <br /> |

### writeToParcel

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |