# NotificationCompat.ProjectedExtender

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/app/NotificationCompat.java+class:androidx.core.app.NotificationCompat.ProjectedExtender) Added in [1.18.0](https://developer.android.com/jetpack/androidx/releases/core#1.18.0)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/core/app/NotificationCompat.ProjectedExtender "View this page in Java")


```
class NotificationCompat.ProjectedExtender : NotificationCompat.Extender
```

<br />

*** ** * ** ***

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/androidx/core/app/NotificationCompat.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/androidx/core/app/NotificationCompat.Builder#extend(androidx.core.app.NotificationCompat.Extender)` to apply the extensions to the notification.

```kotlin
NotificationCompat.Builder builder = new NotificationCompat.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/androidx/core/app/NotificationCompat.ProjectedExtender#ProjectedExtender()()` Create a `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.ProjectedExtender` with default options. |
| `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.ProjectedExtender#ProjectedExtender(android.app.Notification)(notification: https://developer.android.com/reference/android/app/Notification.html)` Creates an `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.ProjectedExtender` from the extensions in a `https://developer.android.com/reference/android/app/Notification.html`. |

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

## Public constructors

### ProjectedExtender

Added in [1.18.0](https://developer.android.com/jetpack/androidx/releases/core#1.18.0)

```
ProjectedExtender()
```

Create a `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.ProjectedExtender` with default options.

### ProjectedExtender

Added in [1.18.0](https://developer.android.com/jetpack/androidx/releases/core#1.18.0)

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

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

| Parameters |
|---|---|
| `notification: https://developer.android.com/reference/android/app/Notification.html` | the notification to extract extensions from. |

## Public functions

### extend

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

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

| Parameters |
|---|---|
| `builder: https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder` | the notification builder to extend |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder` | the modified notification builder |

### getContentIntent

Added in [1.18.0](https://developer.android.com/jetpack/androidx/releases/core#1.18.0)

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

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

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

### setContentIntent

Added in [1.18.0](https://developer.android.com/jetpack/androidx/releases/core#1.18.0)

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

Sets the `https://developer.android.com/reference/android/app/PendingIntent.html` 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/android/app/Notification.html#contentIntent`, which is typically fired when the notification is tapped on the host device (e.g., the phone).

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/app/PendingIntent.html?` | the `https://developer.android.com/reference/android/app/PendingIntent.html` to fire on tap |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.ProjectedExtender` | this `ProjectedExtender` object for chaining |