# ThumbnailTemplate

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Inherited Constants](https://developer.android.com/reference/android/service/controls/templates/ThumbnailTemplate#inhconstants)\|[Ctors](https://developer.android.com/reference/android/service/controls/templates/ThumbnailTemplate#pubctors)\|[Methods](https://developer.android.com/reference/android/service/controls/templates/ThumbnailTemplate#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/service/controls/templates/ThumbnailTemplate#inhmethods)  

# ThumbnailTemplate

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/service/controls/templates/ThumbnailTemplate "View this page in Kotlin")\|Java

`
public

final

class
ThumbnailTemplate
`  
`


``

extends `[ControlTemplate](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate)`


``


`

|---|---|------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.service.controls.templates.ControlTemplate](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate) ||
|   | ↳ | android.service.controls.templates.ThumbnailTemplate |

<br />

*** ** * ** ***

A template for a[Control](https://developer.android.com/reference/android/service/controls/Control)that displays an image.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From class[android.service.controls.templates.ControlTemplate](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate) |-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [TYPE_ERROR](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#TYPE_ERROR) Type identifier of the template returned by[getErrorTemplate()](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#getErrorTemplate()).        | | `int` | [TYPE_NO_TEMPLATE](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#TYPE_NO_TEMPLATE) Type identifier of[ControlTemplate.getNoTemplateObject](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#getNoTemplateObject()). | | `int` | [TYPE_RANGE](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#TYPE_RANGE) Type identifier of[RangeTemplate](https://developer.android.com/reference/android/service/controls/templates/RangeTemplate).                                                           | | `int` | [TYPE_STATELESS](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#TYPE_STATELESS) Type identifier of[StatelessTemplate](https://developer.android.com/reference/android/service/controls/templates/StatelessTemplate).                                           | | `int` | [TYPE_TEMPERATURE](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#TYPE_TEMPERATURE) Type identifier of[TemperatureControlTemplate](https://developer.android.com/reference/android/service/controls/templates/TemperatureControlTemplate).                     | | `int` | [TYPE_THUMBNAIL](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#TYPE_THUMBNAIL) Type identifier of[ThumbnailTemplate](https://developer.android.com/reference/android/service/controls/templates/ThumbnailTemplate).                                           | | `int` | [TYPE_TOGGLE](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#TYPE_TOGGLE) Type identifier of[ToggleTemplate](https://developer.android.com/reference/android/service/controls/templates/ToggleTemplate).                                                       | | `int` | [TYPE_TOGGLE_RANGE](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#TYPE_TOGGLE_RANGE) Type identifier of[ToggleRangeTemplate](https://developer.android.com/reference/android/service/controls/templates/ToggleRangeTemplate).                                 | |

|                                                                                                                                                                                                                                                         ### Public constructors                                                                                                                                                                                                                                                         ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[ThumbnailTemplate](https://developer.android.com/reference/android/service/controls/templates/ThumbnailTemplate#ThumbnailTemplate(java.lang.String,%20boolean,%20android.graphics.drawable.Icon,%20java.lang.CharSequence))`(`[String](https://developer.android.com/reference/java/lang/String)` templateId, boolean active, `[Icon](https://developer.android.com/reference/android/graphics/drawable/Icon)` thumbnail, `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` contentDescription) ` |

|                                                                                                                                                                                                        ### Public methods                                                                                                                                                                                                        ||
|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence) | ` `[getContentDescription](https://developer.android.com/reference/android/service/controls/templates/ThumbnailTemplate#getContentDescription())`() ` The description of the image returned by[ThumbnailTemplate.getThumbnail()](https://developer.android.com/reference/android/service/controls/templates/ThumbnailTemplate#getThumbnail()) |
| ` int`                                                                            | ` `[getTemplateType](https://developer.android.com/reference/android/service/controls/templates/ThumbnailTemplate#getTemplateType())`() ` The template type associated with this class.                                                                                                                                                       |
| ` `[Icon](https://developer.android.com/reference/android/graphics/drawable/Icon) | ` `[getThumbnail](https://developer.android.com/reference/android/service/controls/templates/ThumbnailTemplate#getThumbnail())`() ` The[Icon](https://developer.android.com/reference/android/graphics/drawable/Icon)(image) displayed by this template.                                                                                      |
| ` boolean`                                                                        | ` `[isActive](https://developer.android.com/reference/android/service/controls/templates/ThumbnailTemplate#isActive())`() `                                                                                                                                                                                                                   |

| ### Inherited methods |
|-----------------------|---|
| From class` `[android.service.controls.templates.ControlTemplate](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate)` ` |-------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` static `[ControlTemplate](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate) | ` `[getErrorTemplate](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#getErrorTemplate())`() `                                                                                                                                                                          | | ` static `[ControlTemplate](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate) | ` `[getNoTemplateObject](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#getNoTemplateObject())`() ` Get a singleton[ControlTemplate](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate), which supports no direct user input. | | ` `[String](https://developer.android.com/reference/java/lang/String)                                                   | ` `[getTemplateId](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#getTemplateId())`() `                                                                                                                                                                                | | ` abstract int`                                                                                                         | ` `[getTemplateType](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#getTemplateType())`() ` The template type associated with this class.                                                                                                                              | ||
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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*.                                                                                             | ||

## Public constructors

### ThumbnailTemplate

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

```
public ThumbnailTemplate (String templateId, 
                boolean active, 
                Icon thumbnail, 
                CharSequence contentDescription)
```

<br />

<br />

|                                                                                  Parameters                                                                                   ||
|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| `templateId`         | `String`: the identifier for this template object This value cannot be`null`. <br />                                                                    |
| `active`             | `boolean`: whether the image corresponds to an active (live) stream. <br />                                                                             |
| `thumbnail`          | `Icon`: an image to display on the[Control](https://developer.android.com/reference/android/service/controls/Control)This value cannot be`null`. <br /> |
| `contentDescription` | `CharSequence`: a description of the image for accessibility. This value cannot be`null`. <br />                                                        |

## Public methods

### getContentDescription

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

```
public CharSequence getContentDescription ()
```

The description of the image returned by[ThumbnailTemplate.getThumbnail()](https://developer.android.com/reference/android/service/controls/templates/ThumbnailTemplate#getThumbnail())

<br />

|                                                      Returns                                                       ||
|--------------------------------------------------------------------------------|------------------------------------|
| [CharSequence](https://developer.android.com/reference/java/lang/CharSequence) | This value cannot be`null`. <br /> |

### getTemplateType

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

```
public int getTemplateType ()
```

The template type associated with this class.

<br />

|                                                                          Returns                                                                          ||
|-------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [ControlTemplate.TYPE_THUMBNAIL](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate#TYPE_THUMBNAIL) <br /> |

### getThumbnail

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

```
public Icon getThumbnail ()
```

The[Icon](https://developer.android.com/reference/android/graphics/drawable/Icon)(image) displayed by this template.

<br />

|                                                      Returns                                                       ||
|--------------------------------------------------------------------------------|------------------------------------|
| [Icon](https://developer.android.com/reference/android/graphics/drawable/Icon) | This value cannot be`null`. <br /> |

### isActive

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

```
public boolean isActive ()
```

<br />

<br />

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