Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/service/quicksettings/Tile#constants) \| [Inherited Constants](https://developer.android.com/reference/android/service/quicksettings/Tile#inhconstants) \| [Fields](https://developer.android.com/reference/android/service/quicksettings/Tile#lfields) \| [Methods](https://developer.android.com/reference/android/service/quicksettings/Tile#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/service/quicksettings/Tile#inhmethods)

# Tile

*** ** * ** ***

` public final class Tile `   
` 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.service.quicksettings.Tile |

<br />

*** ** * ** ***

A Tile holds the state of a tile that will be displayed in Quick Settings. A tile in Quick Settings exists as an icon with an accompanied label. It also may have content description for accessibility usability. The style and layout of the tile may change to match a given device.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/service/quicksettings/Tile#STATE_ACTIVE` This represents a tile that is currently active. |
| `int` | `https://developer.android.com/reference/android/service/quicksettings/Tile#STATE_INACTIVE` This represents a tile that is currently in a disabled state but is still interactable. |
| `int` | `https://developer.android.com/reference/android/service/quicksettings/Tile#STATE_UNAVAILABLE` An unavailable state indicates that for some reason this tile is not currently available to the user, and will have no click action. |

### 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/service/quicksettings/Tile>` | `https://developer.android.com/reference/android/service/quicksettings/Tile#CREATOR` <br /> |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#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/service/quicksettings/Tile#getActivityLaunchForClick()() ` Gets the Activity `https://developer.android.com/reference/android/app/PendingIntent` to be launched when the tile is clicked. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#getContentDescription()() ` Gets the current content description for the tile. |
| ` https://developer.android.com/reference/android/graphics/drawable/Icon` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#getIcon()() ` Gets the current icon for the tile. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#getLabel()() ` Gets the current label for the tile. |
| ` int` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#getState()() ` The current state of the tile. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#getStateDescription()() ` Gets the current state description for the tile. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#getSubtitle()() ` Gets the current subtitle for the tile. |
| ` void` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#setActivityLaunchForClick(android.app.PendingIntent)(https://developer.android.com/reference/android/app/PendingIntent pendingIntent) ` Sets an Activity `https://developer.android.com/reference/android/app/PendingIntent` to be launched when the tile is clicked. |
| ` void` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#setContentDescription(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence contentDescription) ` Sets the current content description for the tile. |
| ` void` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#setIcon(android.graphics.drawable.Icon)(https://developer.android.com/reference/android/graphics/drawable/Icon icon) ` Sets the current icon for the tile. |
| ` void` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#setLabel(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence label) ` Sets the current label for the tile. |
| ` void` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#setState(int)(int state) ` Sets the current state for the tile. |
| ` void` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#setStateDescription(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence stateDescription) ` Sets the current state description for the tile. |
| ` void` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#setSubtitle(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence subtitle) ` Set the subtitle for the tile. |
| ` void` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#updateTile()() ` Pushes the state of the Tile to Quick Settings to be displayed. |
| ` void` | ` https://developer.android.com/reference/android/service/quicksettings/Tile#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

### STATE_ACTIVE

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

```
public static final int STATE_ACTIVE
```

This represents a tile that is currently active. (e.g. wifi is connected, bluetooth is on, cast is casting). This is the default state.

<br />

Constant Value: 2 (0x00000002)

### STATE_INACTIVE

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

```
public static final int STATE_INACTIVE
```

This represents a tile that is currently in a disabled state but is still interactable. A disabled state indicates that the tile is not currently active (e.g. wifi disconnected or bluetooth disabled), but is still interactable by the user to modify this state. Tiles that have boolean states should use this to represent one of their states. The tile's icon will be tinted differently to reflect this state, but still be distinct from unavailable.

<br />

Constant Value: 1 (0x00000001)

### STATE_UNAVAILABLE

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

```
public static final int STATE_UNAVAILABLE
```

An unavailable state indicates that for some reason this tile is not currently available to the user, and will have no click action. The tile's icon will be tinted differently to reflect this state.

<br />

Constant Value: 0 (0x00000000)

## Fields

### CREATOR

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

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

<br />

<br />

## Public methods

### describeContents

Added in [API level 24](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` |

### getActivityLaunchForClick

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

```
public PendingIntent getActivityLaunchForClick ()
```

Gets the Activity `https://developer.android.com/reference/android/app/PendingIntent` to be launched when the tile is clicked.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/PendingIntent` | This value may be `null`. <br /> |

### getContentDescription

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

```
public CharSequence getContentDescription ()
```

Gets the current content description for the tile.

<br />

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

### getIcon

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

```
public Icon getIcon ()
```

Gets the current icon for the tile.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Icon` | <br /> |

### getLabel

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

```
public CharSequence getLabel ()
```

Gets the current label for the tile.

<br />

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

### getState

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

```
public int getState ()
```

The current state of the tile.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/service/quicksettings/Tile#STATE_UNAVAILABLE`
- `https://developer.android.com/reference/android/service/quicksettings/Tile#STATE_INACTIVE`
- `https://developer.android.com/reference/android/service/quicksettings/Tile#STATE_ACTIVE`

### getStateDescription

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

```
public CharSequence getStateDescription ()
```

Gets the current state description for the tile.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | This value may be `null`. <br /> |

### getSubtitle

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

```
public CharSequence getSubtitle ()
```

Gets the current subtitle for the tile.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | This value may be `null`. <br /> |

### setActivityLaunchForClick

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

```
public void setActivityLaunchForClick (PendingIntent pendingIntent)
```

Sets an Activity `https://developer.android.com/reference/android/app/PendingIntent` to be launched when the tile is clicked. The last value set here will be launched when the user clicks in the tile, instead of forwarding the \`onClick\` message to the `https://developer.android.com/reference/android/service/quicksettings/TileService`. Set to `null` to handle the \`onClick\` in the \`TileService\` (This is the default behavior if this method is never called.)

<br />

| Parameters ||
|---|---|
| `pendingIntent` | `PendingIntent`: a PendingIntent for an activity to be launched onclick, or `null` to handle the clicks in the \`TileService\`. <br /> |

### setContentDescription

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

```
public void setContentDescription (CharSequence contentDescription)
```

Sets the current content description for the tile. Does not take effect until `https://developer.android.com/reference/android/service/quicksettings/Tile#updateTile()` is called.

<br />

| Parameters ||
|---|---|
| `contentDescription` | `CharSequence`: New content description to use. <br /> |

### setIcon

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

```
public void setIcon (Icon icon)
```

Sets the current icon for the tile. This icon is expected to be white on alpha, and may be tinted by the system to match it's theme. Does not take effect until `https://developer.android.com/reference/android/service/quicksettings/Tile#updateTile()` is called.

<br />

| Parameters ||
|---|---|
| `icon` | `Icon`: New icon to show. <br /> |

### setLabel

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

```
public void setLabel (CharSequence label)
```

Sets the current label for the tile. Does not take effect until `https://developer.android.com/reference/android/service/quicksettings/Tile#updateTile()` is called.

<br />

| Parameters ||
|---|---|
| `label` | `CharSequence`: New label to show. <br /> |

### setState

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

```
public void setState (int state)
```

Sets the current state for the tile. Does not take effect until `https://developer.android.com/reference/android/service/quicksettings/Tile#updateTile()` is called.

<br />

| Parameters ||
|---|---|
| `state` | `int`: One of `https://developer.android.com/reference/android/service/quicksettings/Tile#STATE_UNAVAILABLE`, `https://developer.android.com/reference/android/service/quicksettings/Tile#STATE_INACTIVE`, `https://developer.android.com/reference/android/service/quicksettings/Tile#STATE_ACTIVE` <br /> |

### setStateDescription

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

```
public void setStateDescription (CharSequence stateDescription)
```

Sets the current state description for the tile. Does not take effect until `https://developer.android.com/reference/android/service/quicksettings/Tile#updateTile()` is called.

<br />

| Parameters ||
|---|---|
| `stateDescription` | `CharSequence`: New state description to use. This value may be `null`. <br /> |

### setSubtitle

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

```
public void setSubtitle (CharSequence subtitle)
```

Set the subtitle for the tile. Will be displayed as the secondary label.

<br />

| Parameters ||
|---|---|
| `subtitle` | `CharSequence`: the subtitle to show. This value may be `null`. <br /> |

### updateTile

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

```
public void updateTile ()
```

Pushes the state of the Tile to Quick Settings to be displayed.

<br />

### writeToParcel

Added in [API level 24](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` |