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

# TvExtender

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/app/Notification.TvExtender "View this page in Java")

```
class TvExtender : Notification.Extender
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.app.Notification.TvExtender](https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#) |

Helper class to add Android TV extensions to notifications. To create a notification with a TV extension:

1. Create an `https://developer.android.com/reference/kotlin/android/app/Notification.Builder`, setting any desired properties.
2. Create a `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#`.
3. Set TV-specific properties using the `set` methods of `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#`.
4. Call `https://developer.android.com/reference/kotlin/android/app/Notification.Builder#extend(android.app.Notification.Extender)` to apply the extension to a notification.

```kotlin
Notification notification = new Notification.Builder(context)
          ...
          .extend(new TvExtender()
                  .set*(...))
          .build();
  
```

TV extensions can be accessed on an existing notification by using the `TvExtender(Notification)` constructor, and then using the `get` methods to access values.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#TvExtender()()` Create a `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#` with default options. |
| `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#TvExtender(android.app.Notification)(notif: https://developer.android.com/reference/kotlin/android/app/Notification)` Create a `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#` from the TvExtender options of an existing Notification. |

| Public methods ||
|---|---|
| [Notification.Builder](https://developer.android.com/reference/kotlin/android/app/Notification.Builder) | `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#extend(android.app.Notification.Builder)(builder: https://developer.android.com/reference/kotlin/android/app/Notification.Builder)` Apply a TV extension to a notification that is being built. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#getChannelId()()` Returns the id of the channel this notification posts to on TV. |
| [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent)? | `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#getContentIntent()()` Returns the TV-specific content intent. |
| [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent)? | `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#getDeleteIntent()()` Returns the TV-specific delete intent. |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#isAvailableOnTv()()` Returns `true` if this notification should be shown on TV. |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#isSuppressShowOverApps()()` Returns `true` if this notification should not show messages over top of apps outside of the launcher. |
| [Notification.TvExtender](https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#) | `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#setChannelId(kotlin.String)(channelId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?)` Specifies the channel the notification should be delivered on when shown on TV. |
| [Notification.TvExtender](https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#) | `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#setContentIntent(android.app.PendingIntent)(intent: https://developer.android.com/reference/kotlin/android/app/PendingIntent?)` Supplies a `https://developer.android.com/reference/kotlin/android/app/PendingIntent` to be sent when the notification is selected on TV. |
| [Notification.TvExtender](https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#) | `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#setDeleteIntent(android.app.PendingIntent)(intent: https://developer.android.com/reference/kotlin/android/app/PendingIntent?)` Supplies a `https://developer.android.com/reference/kotlin/android/app/PendingIntent` to send when the notification is cleared explicitly by the user on TV. |
| [Notification.TvExtender](https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#) | `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#setSuppressShowOverApps(kotlin.Boolean)(suppress: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` Specifies whether this notification should suppress showing a message over top of apps outside of the launcher. |

## Public constructors

### TvExtender

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

```
TvExtender()
```

Create a `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#` with default options.

### TvExtender

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

```
TvExtender(notif: Notification)
```

Create a `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#` from the TvExtender options of an existing Notification.

| Parameters ||
|---|---|
| `notif` | [Notification](https://developer.android.com/reference/kotlin/android/app/Notification): the notification from which to copy options. This value cannot be `null`. |

## Public methods

### extend

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

```
fun extend(builder: Notification.Builder): Notification.Builder
```

Apply a TV extension to a notification that is being built. This is typically called by the `https://developer.android.com/reference/kotlin/android/app/Notification.Builder#extend(android.app.Notification.Extender)` method of `https://developer.android.com/reference/kotlin/android/app/Notification.Builder`.

| Parameters ||
|---|---|
| `builder` | [Notification.Builder](https://developer.android.com/reference/kotlin/android/app/Notification.Builder): This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/Notification.Builder` | This value cannot be `null`. |

### getChannelId

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

```
fun getChannelId(): String?
```

Returns the id of the channel this notification posts to on TV.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | This value may be `null`. |

### getContentIntent

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

```
fun getContentIntent(): PendingIntent?
```

Returns the TV-specific content intent. If this method returns null, the main content intent on the notification should be used.
**See Also**

- `https://developer.android.com/reference/kotlin/android/app/Notification#contentIntent:android.app.PendingIntent`

### getDeleteIntent

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

```
fun getDeleteIntent(): PendingIntent?
```

Returns the TV-specific delete intent. If this method returns null, the main delete intent on the notification should be used.
**See Also**

- `https://developer.android.com/reference/kotlin/android/app/Notification#deleteIntent:android.app.PendingIntent`

### isAvailableOnTv

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

```
fun isAvailableOnTv(): Boolean
```

Returns `true` if this notification should be shown on TV. This method returns `true` if the notification was extended with a TvExtender.

### isSuppressShowOverApps

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

```
fun isSuppressShowOverApps(): Boolean
```

Returns `true` if this notification should not show messages over top of apps outside of the launcher.

### setChannelId

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

```
fun setChannelId(channelId: String?): Notification.TvExtender
```

Specifies the channel the notification should be delivered on when shown on TV. It can be different from the channel that the notification is delivered to when posting on a non-TV device.

| Parameters ||
|---|---|
| `channelId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?: This value may be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#` | this object for method chaining. This value cannot be `null`. |

### setContentIntent

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

```
fun setContentIntent(intent: PendingIntent?): Notification.TvExtender
```

Supplies a `https://developer.android.com/reference/kotlin/android/app/PendingIntent` to be sent when the notification is selected on TV. If provided, it is used instead of the content intent specified at the level of Notification.

| Parameters ||
|---|---|
| `intent` | [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent)?: the `https://developer.android.com/reference/kotlin/android/app/PendingIntent` for the associated notification content. This value may be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#` | this object for method chaining. This value cannot be `null`. |

### setDeleteIntent

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

```
fun setDeleteIntent(intent: PendingIntent?): Notification.TvExtender
```

Supplies a `https://developer.android.com/reference/kotlin/android/app/PendingIntent` to send when the notification is cleared explicitly by the user on TV. If provided, it is used instead of the delete intent specified at the level of Notification.

| Parameters ||
|---|---|
| `intent` | [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent)?: the `https://developer.android.com/reference/kotlin/android/app/PendingIntent` for the associated notification deletion. This value may be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#` | this object for method chaining. This value cannot be `null`. |

### setSuppressShowOverApps

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

```
fun setSuppressShowOverApps(suppress: Boolean): Notification.TvExtender
```

Specifies whether this notification should suppress showing a message over top of apps outside of the launcher.

| Parameters ||
|---|---|
| `suppress` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): whether the notification should suppress showing over apps |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/Notification.TvExtender#` | this object for method chaining. This value cannot be `null`. |