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

# ProjectedExtender

*** ** * ** ***

```
class ProjectedExtender : Notification.Extender
```

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

Helper class to add projection-specific extensions to a notification. This class is used to specify metadata that is specific to notifications that may be displayed on a Projected device.

To create a notification with Projected extensions:

1. Create a `https://developer.android.com/reference/kotlin/android/app/Notification.Builder` for the notification.
2. Create an `ProjectedExtender`.
3. Set projection-specific properties using the `set` methods on the `ProjectedExtender`.
4. Call `https://developer.android.com/reference/kotlin/android/app/Notification.Builder#extend(android.app.Notification.Extender)` to apply the extensions to the notification.

```kotlin
Notification.Builder builder = new Notification.Builder(context, CHANNEL_ID)
      .setContentTitle("Example Title")
      .setContentText("Example Text")
      .setSmallIcon(R.drawable.ic_notification);
 
  ProjectedExtender projectedExtender = new ProjectedExtender()
      .setContentIntent(projectedTapIntent);
 
  builder.extend(projectedExtender);
  notificationManager.notify(NOTIFICATION_ID, builder.build());
  
```

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/Notification.ProjectedExtender#ProjectedExtender()()` Create a `https://developer.android.com/reference/kotlin/android/app/Notification.ProjectedExtender#` with default options. |
| `https://developer.android.com/reference/kotlin/android/app/Notification.ProjectedExtender#ProjectedExtender(android.app.Notification)(notification: https://developer.android.com/reference/kotlin/android/app/Notification)` Creates an `https://developer.android.com/reference/kotlin/android/app/Notification.ProjectedExtender#` from the extensions in a `https://developer.android.com/reference/kotlin/android/app/Notification`. |

| Public methods ||
|---|---|
| [Notification.Builder](https://developer.android.com/reference/kotlin/android/app/Notification.Builder) | `https://developer.android.com/reference/kotlin/android/app/Notification.ProjectedExtender#extend(android.app.Notification.Builder)(builder: https://developer.android.com/reference/kotlin/android/app/Notification.Builder)` Applies the Projected extensions to the notification builder. |
| [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent)? | `https://developer.android.com/reference/kotlin/android/app/Notification.ProjectedExtender#getContentIntent()()` Returns the `https://developer.android.com/reference/kotlin/android/app/PendingIntent` to be fired when the notification is tapped on the Projected device. |
| [Notification.ProjectedExtender](https://developer.android.com/reference/kotlin/android/app/Notification.ProjectedExtender#) | `https://developer.android.com/reference/kotlin/android/app/Notification.ProjectedExtender#setContentIntent(android.app.PendingIntent)(intent: https://developer.android.com/reference/kotlin/android/app/PendingIntent?)` Sets the `https://developer.android.com/reference/kotlin/android/app/PendingIntent` to be opened on the Projected device when the notification is tapped on the that device. |

## Public constructors

### ProjectedExtender

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

```
ProjectedExtender()
```

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

### ProjectedExtender

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

```
ProjectedExtender(notification: Notification)
```

Creates an `https://developer.android.com/reference/kotlin/android/app/Notification.ProjectedExtender#` from the extensions in a `https://developer.android.com/reference/kotlin/android/app/Notification`.

| Parameters ||
|---|---|
| `notification` | [Notification](https://developer.android.com/reference/kotlin/android/app/Notification): The notification to extract extensions from. This value cannot be `null`. |

## Public methods

### extend

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

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

Applies the Projected extensions to the notification builder. This method is called by the `https://developer.android.com/reference/kotlin/android/app/Notification.Builder#extend(android.app.Notification.Extender)` method and should not be called directly.

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

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

### getContentIntent

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

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

Returns the `https://developer.android.com/reference/kotlin/android/app/PendingIntent` to be fired when the notification is tapped on the Projected device.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/PendingIntent?` | the `https://developer.android.com/reference/kotlin/android/app/PendingIntent` to fire on tap, or null if not set |

### setContentIntent

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

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

Sets the `https://developer.android.com/reference/kotlin/android/app/PendingIntent` to be opened on the Projected device when the notification is tapped on the that device. This is distinct from the notification's main `https://developer.android.com/reference/kotlin/android/app/Notification#contentIntent:android.app.PendingIntent`, which is typically fired when the notification is tapped on the host device (e.g., the phone).

| Parameters ||
|---|---|
| `intent` | [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent)?: the `https://developer.android.com/reference/kotlin/android/app/PendingIntent` to fire on tap. This value may be `null`. |

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