added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)   
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1 Summary: [Nested Classes](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#nestedclasses) \| [Ctors](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#pubctors) \| [Methods](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#inhmethods) \| [\[Expand All\]](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#)

# NotificationCompat.CarExtender

| This package is part of the Android [support library](https://developer.android.com/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](https://developer.android.com/jetpack/androidx) which is part of [Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](https://developer.android.com/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class
| mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).


`
public
static
final

class
NotificationCompat.CarExtender
`


`

extends Object


`

`


implements

https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Extender


`

|---|---|
| java.lang.Object ||
| ↳ | android.support.v4.app.NotificationCompat.CarExtender |

<br />

*** ** * ** ***

<br />

Helper class to add Android Auto extensions to notifications. To create a notification
with car extensions:

1. Create an `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder`, setting any desired properties.
2. Create a `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender`.
3. Set car-specific properties using the `add` and `set` methods of `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender`.
4. Call `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder#extend(android.support.v4.app.NotificationCompat.Extender)` to apply the extensions to a notification.
5. Post the notification to the notification system with the `NotificationManagerCompat.notify(...)` methods and not the `NotificationManager.notify(...)` methods.

```jasmin
 Notification notification = new NotificationCompat.Builder(context)
         ...
         .extend(new CarExtender()
                 .set*(...))
         .build();
 
```

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

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender.UnreadConversation` A class which holds the unread messages from a conversation. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#NotificationCompat.CarExtender()() ` Create a `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender` with default options. |
| ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#NotificationCompat.CarExtender(android.app.Notification)(https://developer.android.com/reference/android/app/Notification.html notification) ` Create a `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender` from the CarExtender options of an existing Notification. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder` | ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#extend(android.support.v4.app.NotificationCompat.Builder)(https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder builder) ` Apply car extensions to a notification that is being built. |
| ` int` | ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#getColor()() ` Gets the accent color. |
| ` https://developer.android.com/reference/android/graphics/Bitmap.html` | ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#getLargeIcon()() ` Gets the large icon used in this car notification, or null if no icon has been set. |
| ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender.UnreadConversation` | ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#getUnreadConversation()() ` Returns the unread conversation conveyed by this notification. |
| ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender` | ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#setColor(int)(int color) ` Sets the accent color to use when Android Auto presents the notification. |
| ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender` | ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#setLargeIcon(android.graphics.Bitmap)(https://developer.android.com/reference/android/graphics/Bitmap.html largeIcon) ` Sets the large icon of the car notification. |
| ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender` | ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#setUnreadConversation(android.support.v4.app.NotificationCompat.CarExtender.UnreadConversation)(https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender.UnreadConversation unreadConversation) ` Sets the unread conversation in a message notification. |

| ### Inherited methods |
|---|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#)From class ` java.lang.Object ` |---|---| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class<?>` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#)From interface ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Extender ` |---|---| | ` abstract https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder` | ` https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Extender#extend(android.support.v4.app.NotificationCompat.Builder)(https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder builder) ` Apply this extender to a notification builder. | ||

## Public constructors

### NotificationCompat.CarExtender

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
NotificationCompat.CarExtender ()
```

Create a `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender` with default options.

<br />

### NotificationCompat.CarExtender

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
NotificationCompat.CarExtender (Notification notification)
```

Create a `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender` from the CarExtender options of an existing Notification.

<br />

| Parameters ||
|---|---|
| `notification` | `Notification`: The notification from which to copy options. <br /> |

## Public methods

### extend

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

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

Apply car extensions to a notification that is being built. This is typically called by
the `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder#extend(android.support.v4.app.NotificationCompat.Extender)`
method of `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder`.

<br />

| Parameters ||
|---|---|
| `builder` | `NotificationCompat.Builder`: the builder to be modified. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder` | the build object for chaining. <br /> |

### getColor

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
int getColor ()
```

Gets the accent color.

<br />

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

**See also:**

- `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#setColor(int)`

### getLargeIcon

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
Bitmap getLargeIcon ()
```

Gets the large icon used in this car notification, or null if no icon has been set.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Bitmap.html` | The large icon for the car notification. <br /> |

**See also:**

- `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#setLargeIcon(android.graphics.Bitmap)`

### getUnreadConversation

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
NotificationCompat.CarExtender.UnreadConversation getUnreadConversation ()
```

Returns the unread conversation conveyed by this notification.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender.UnreadConversation` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender#setUnreadConversation(android.support.v4.app.NotificationCompat.CarExtender.UnreadConversation)`

### setColor

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
NotificationCompat.CarExtender setColor (int color)
```

Sets the accent color to use when Android Auto presents the notification.

Android Auto uses the color set with `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder#setColor(int)`
to accent the displayed notification. However, not all colors are acceptable in an
automotive setting. This method can be used to override the color provided in the
notification in such a situation.

<br />

| Parameters ||
|---|---|
| `color` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender` | <br /> |

### setLargeIcon

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
NotificationCompat.CarExtender setLargeIcon (Bitmap largeIcon)
```

Sets the large icon of the car notification.

If no large icon is set in the extender, Android Auto will display the icon
specified by `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder#setLargeIcon(android.graphics.Bitmap)`

<br />

| Parameters ||
|---|---|
| `largeIcon` | `Bitmap`: The large icon to use in the car notification. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender` | This object for method chaining. <br /> |

### setUnreadConversation

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
NotificationCompat.CarExtender setUnreadConversation (NotificationCompat.CarExtender.UnreadConversation unreadConversation)
```

Sets the unread conversation in a message notification.

<br />

| Parameters ||
|---|---|
| `unreadConversation` | `NotificationCompat.CarExtender.UnreadConversation`: The unread part of the conversation this notification conveys. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender` | This object for method chaining. <br /> |

-

  ## Annotations

  - [NotificationCompat.Action.SemanticAction](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action.SemanticAction)
-

  ## Interfaces

  - [ActionBarDrawerToggle.Delegate](https://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.Delegate)
  - [ActionBarDrawerToggle.DelegateProvider](https://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.DelegateProvider)
  - [ActivityCompat.OnRequestPermissionsResultCallback](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback)
  - [ActivityCompat.PermissionCompatDelegate](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.PermissionCompatDelegate)
  - [FragmentManager.BackStackEntry](https://developer.android.com/reference/android/support/v4/app/FragmentManager.BackStackEntry)
  - [FragmentManager.OnBackStackChangedListener](https://developer.android.com/reference/android/support/v4/app/FragmentManager.OnBackStackChangedListener)
  - [LoaderManager.LoaderCallbacks](https://developer.android.com/reference/android/support/v4/app/LoaderManager.LoaderCallbacks)
  - [NotificationCompat.Action.Extender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action.Extender)
  - [NotificationCompat.Extender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Extender)
  - [SharedElementCallback.OnSharedElementsReadyListener](https://developer.android.com/reference/android/support/v4/app/SharedElementCallback.OnSharedElementsReadyListener)
  - [TaskStackBuilder.SupportParentable](https://developer.android.com/reference/android/support/v4/app/TaskStackBuilder.SupportParentable)
-

  ## Classes

  - [ActionBarDrawerToggle](https://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle)
  - [ActivityCompat](https://developer.android.com/reference/android/support/v4/app/ActivityCompat)
  - [ActivityManagerCompat](https://developer.android.com/reference/android/support/v4/app/ActivityManagerCompat)
  - [ActivityOptionsCompat](https://developer.android.com/reference/android/support/v4/app/ActivityOptionsCompat)
  - [AlarmManagerCompat](https://developer.android.com/reference/android/support/v4/app/AlarmManagerCompat)
  - [AppLaunchChecker](https://developer.android.com/reference/android/support/v4/app/AppLaunchChecker)
  - [AppOpsManagerCompat](https://developer.android.com/reference/android/support/v4/app/AppOpsManagerCompat)
  - [BundleCompat](https://developer.android.com/reference/android/support/v4/app/BundleCompat)
  - [DialogFragment](https://developer.android.com/reference/android/support/v4/app/DialogFragment)
  - [Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment)
  - [Fragment.SavedState](https://developer.android.com/reference/android/support/v4/app/Fragment.SavedState)
  - [FragmentActivity](https://developer.android.com/reference/android/support/v4/app/FragmentActivity)
  - [FragmentContainer](https://developer.android.com/reference/android/support/v4/app/FragmentContainer)
  - [FragmentController](https://developer.android.com/reference/android/support/v4/app/FragmentController)
  - [FragmentHostCallback](https://developer.android.com/reference/android/support/v4/app/FragmentHostCallback)
  - [FragmentManager](https://developer.android.com/reference/android/support/v4/app/FragmentManager)
  - [FragmentManager.FragmentLifecycleCallbacks](https://developer.android.com/reference/android/support/v4/app/FragmentManager.FragmentLifecycleCallbacks)
  - [FragmentManagerNonConfig](https://developer.android.com/reference/android/support/v4/app/FragmentManagerNonConfig)
  - [FragmentPagerAdapter](https://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter)
  - [FragmentStatePagerAdapter](https://developer.android.com/reference/android/support/v4/app/FragmentStatePagerAdapter)
  - [FragmentTabHost](https://developer.android.com/reference/android/support/v4/app/FragmentTabHost)
  - [FragmentTransaction](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction)
  - [FrameMetricsAggregator](https://developer.android.com/reference/android/support/v4/app/FrameMetricsAggregator)
  - [JobIntentService](https://developer.android.com/reference/android/support/v4/app/JobIntentService)
  - [ListFragment](https://developer.android.com/reference/android/support/v4/app/ListFragment)
  - [LoaderManager](https://developer.android.com/reference/android/support/v4/app/LoaderManager)
  - [NavUtils](https://developer.android.com/reference/android/support/v4/app/NavUtils)
  - [NotificationCompat](https://developer.android.com/reference/android/support/v4/app/NotificationCompat)
  - [NotificationCompat.Action](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action)
  - [NotificationCompat.Action.Builder](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action.Builder)
  - [NotificationCompat.Action.WearableExtender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action.WearableExtender)
  - [NotificationCompat.BigPictureStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.BigPictureStyle)
  - [NotificationCompat.BigTextStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.BigTextStyle)
  - [NotificationCompat.Builder](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder)
  - [NotificationCompat.CarExtender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender)
  - [NotificationCompat.CarExtender.UnreadConversation](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender.UnreadConversation)
  - [NotificationCompat.CarExtender.UnreadConversation.Builder](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender.UnreadConversation.Builder)
  - [NotificationCompat.DecoratedCustomViewStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.DecoratedCustomViewStyle)
  - [NotificationCompat.InboxStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.InboxStyle)
  - [NotificationCompat.MessagingStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.MessagingStyle)
  - [NotificationCompat.MessagingStyle.Message](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.MessagingStyle.Message)
  - [NotificationCompat.Style](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Style)
  - [NotificationCompat.WearableExtender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.WearableExtender)
  - [NotificationCompatExtras](https://developer.android.com/reference/android/support/v4/app/NotificationCompatExtras)
  - [NotificationCompatSideChannelService](https://developer.android.com/reference/android/support/v4/app/NotificationCompatSideChannelService)
  - [NotificationManagerCompat](https://developer.android.com/reference/android/support/v4/app/NotificationManagerCompat)
  - [RemoteInput](https://developer.android.com/reference/android/support/v4/app/RemoteInput)
  - [RemoteInput.Builder](https://developer.android.com/reference/android/support/v4/app/RemoteInput.Builder)
  - [ServiceCompat](https://developer.android.com/reference/android/support/v4/app/ServiceCompat)
  - [ShareCompat](https://developer.android.com/reference/android/support/v4/app/ShareCompat)
  - [ShareCompat.IntentBuilder](https://developer.android.com/reference/android/support/v4/app/ShareCompat.IntentBuilder)
  - [ShareCompat.IntentReader](https://developer.android.com/reference/android/support/v4/app/ShareCompat.IntentReader)
  - [SharedElementCallback](https://developer.android.com/reference/android/support/v4/app/SharedElementCallback)
  - [TaskStackBuilder](https://developer.android.com/reference/android/support/v4/app/TaskStackBuilder)
-

  ## Exceptions

  - [Fragment.InstantiationException](https://developer.android.com/reference/android/support/v4/app/Fragment.InstantiationException)