Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/app/Notification.TvExtender#pubctors) \| [Methods](https://developer.android.com/reference/android/app/Notification.TvExtender#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/Notification.TvExtender#inhmethods)

# Notification.TvExtender

*** ** * ** ***

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


`
public
static
final

class
Notification.TvExtender
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/app/Notification.Extender


`

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

<br />

*** ** * ** ***

<br />

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

```jasmin
 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/android/app/Notification.TvExtender#TvExtender()() ` Create a `https://developer.android.com/reference/android/app/Notification.TvExtender` with default options. |
| ` https://developer.android.com/reference/android/app/Notification.TvExtender#TvExtender(android.app.Notification)(https://developer.android.com/reference/android/app/Notification notif) ` Create a `https://developer.android.com/reference/android/app/Notification.TvExtender` from the TvExtender options of an existing Notification. |

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

| ### 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/app/Notification.Extender ` |---|---| | ` abstract https://developer.android.com/reference/android/app/Notification.Builder` | ` https://developer.android.com/reference/android/app/Notification.Extender#extend(android.app.Notification.Builder)(https://developer.android.com/reference/android/app/Notification.Builder builder) ` Apply this extender to a notification builder. | ||

## Public constructors

### TvExtender

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

```
public TvExtender ()
```

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

<br />

### TvExtender

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

```
public TvExtender (Notification notif)
```

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

<br />

| Parameters ||
|---|---|
| `notif` | `Notification`: the notification from which to copy options. This value cannot be `null`. <br /> |

## Public methods

### extend

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

```
public Notification.Builder extend (Notification.Builder builder)
```

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

<br />

| Parameters ||
|---|---|
| `builder` | `Notification.Builder`: This value cannot be `null`. <br /> |

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

### getChannelId

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

```
public String getChannelId ()
```

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

<br />

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

### getContentIntent

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

```
public PendingIntent getContentIntent ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/PendingIntent` | <br /> |

**See also:**

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

### getDeleteIntent

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

```
public PendingIntent getDeleteIntent ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/PendingIntent` | <br /> |

**See also:**

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

### isAvailableOnTv

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

```
public boolean isAvailableOnTv ()
```

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

<br />

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

### isSuppressShowOverApps

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

```
public boolean isSuppressShowOverApps ()
```

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

<br />

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

### setChannelId

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

```
public Notification.TvExtender setChannelId (String channelId)
```

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.

<br />

| Parameters ||
|---|---|
| `channelId` | `String`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.TvExtender` | this object for method chaining. This value cannot be `null`. <br /> |

### setContentIntent

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

```
public Notification.TvExtender setContentIntent (PendingIntent intent)
```

Supplies a `https://developer.android.com/reference/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.

<br />

| Parameters ||
|---|---|
| `intent` | `PendingIntent`: the `https://developer.android.com/reference/android/app/PendingIntent` for the associated notification content. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.TvExtender` | this object for method chaining. This value cannot be `null`. <br /> |

### setDeleteIntent

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

```
public Notification.TvExtender setDeleteIntent (PendingIntent intent)
```

Supplies a `https://developer.android.com/reference/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.

<br />

| Parameters ||
|---|---|
| `intent` | `PendingIntent`: the `https://developer.android.com/reference/android/app/PendingIntent` for the associated notification deletion. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.TvExtender` | this object for method chaining. This value cannot be `null`. <br /> |

### setSuppressShowOverApps

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

```
public Notification.TvExtender setSuppressShowOverApps (boolean suppress)
```

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

<br />

| Parameters ||
|---|---|
| `suppress` | `boolean`: whether the notification should suppress showing over apps <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.TvExtender` | this object for method chaining. This value cannot be `null`. <br /> |