# Notification.CarExtender.Builder

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

# Notification.CarExtender.Builder

*** ** * ** ***

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

`
public
static


class
Notification.CarExtender.Builder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

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

<br />

*** ** * ** ***

Builder class for[CarExtender.UnreadConversation](https://developer.android.com/reference/android/app/Notification.CarExtender.UnreadConversation)objects.

## Summary

|                                                                                                                                                                           ### Public constructors                                                                                                                                                                            ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Builder](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder#Builder(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` name) ` Constructs a new builder for[CarExtender.UnreadConversation](https://developer.android.com/reference/android/app/Notification.CarExtender.UnreadConversation). |

|                                                                                                                                                                                                                                                                                                        ### Public methods                                                                                                                                                                                                                                                                                                         ||
|---------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[Notification.CarExtender.Builder](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder)                       | ` `[addMessage](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder#addMessage(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` message) ` Appends a new unread message to the list of messages for this conversation.                                                                                                                                                                                |
| ` `[Notification.CarExtender.UnreadConversation](https://developer.android.com/reference/android/app/Notification.CarExtender.UnreadConversation) | ` `[build](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder#build())`() ` Builds a new unread conversation object.                                                                                                                                                                                                                                                                                                                         |
| ` `[Notification.CarExtender.Builder](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder)                       | ` `[setLatestTimestamp](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder#setLatestTimestamp(long))`(long timestamp) ` Sets the timestamp of the most recent message in an unread conversation.                                                                                                                                                                                                                                             |
| ` `[Notification.CarExtender.Builder](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder)                       | ` `[setReadPendingIntent](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder#setReadPendingIntent(android.app.PendingIntent))`(`[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent)` pendingIntent) ` Sets the pending intent that will be sent once the messages in this notification are read.                                                                                                              |
| ` `[Notification.CarExtender.Builder](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder)                       | ` `[setReplyAction](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder#setReplyAction(android.app.PendingIntent,%20android.app.RemoteInput))`(`[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent)` pendingIntent, `[RemoteInput](https://developer.android.com/reference/android/app/RemoteInput)` remoteInput) ` Sets the pending intent and remote input which will convey the reply to this notification. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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*.                                                                                             | ||

## Public constructors

### Builder

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

```
public Builder (String name)
```

Constructs a new builder for[CarExtender.UnreadConversation](https://developer.android.com/reference/android/app/Notification.CarExtender.UnreadConversation).

<br />

|                                   Parameters                                   ||
|--------|------------------------------------------------------------------------|
| `name` | `String`: the name of the other participant in the conversation <br /> |

## Public methods

### addMessage

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

```
public Notification.CarExtender.Builder addMessage (String message)
```

Appends a new unread message to the list of messages for this conversation.

The messages should be added from oldest to newest.

<br />

|                           Parameters                           ||
|-----------|-----------------------------------------------------|
| `message` | `String`: the text of the new unread message <br /> |

|                                                                             Returns                                                                              ||
|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------|
| [Notification.CarExtender.Builder](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder) | this object for method chaining <br /> |

### build

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

```
public Notification.CarExtender.UnreadConversation build ()
```

Builds a new unread conversation object.

<br />

|                                                                                          Returns                                                                                          ||
|------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
| [Notification.CarExtender.UnreadConversation](https://developer.android.com/reference/android/app/Notification.CarExtender.UnreadConversation) | the new unread conversation object <br /> |

### setLatestTimestamp

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

```
public Notification.CarExtender.Builder setLatestTimestamp (long timestamp)
```

Sets the timestamp of the most recent message in an unread conversation.

If a messaging notification has been posted by your application and has not yet been cancelled, posting a later notification with the same id and tag but without a newer timestamp may result in Android Auto not displaying a heads up notification for the later notification.

<br />

|                                        Parameters                                        ||
|-------------|-----------------------------------------------------------------------------|
| `timestamp` | `long`: the timestamp of the most recent message in the conversation <br /> |

|                                                                             Returns                                                                              ||
|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------|
| [Notification.CarExtender.Builder](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder) | this object for method chaining <br /> |

### setReadPendingIntent

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

```
public Notification.CarExtender.Builder setReadPendingIntent (PendingIntent pendingIntent)
```

Sets the pending intent that will be sent once the messages in this notification are read.

<br />

|                             Parameters                             ||
|-----------------|---------------------------------------------------|
| `pendingIntent` | `PendingIntent`: the pending intent to use <br /> |

|                                                                             Returns                                                                              ||
|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------|
| [Notification.CarExtender.Builder](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder) | this object for method chaining <br /> |

### setReplyAction

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

```
public Notification.CarExtender.Builder setReplyAction (PendingIntent pendingIntent, 
                RemoteInput remoteInput)
```

Sets the pending intent and remote input which will convey the reply to this notification.

<br />

|                                           Parameters                                           ||
|-----------------|-------------------------------------------------------------------------------|
| `pendingIntent` | `PendingIntent`: the pending intent which will be triggered on a reply <br /> |
| `remoteInput`   | `RemoteInput`: the remote input parcelable which will carry the reply <br />  |

|                                                                             Returns                                                                              ||
|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------|
| [Notification.CarExtender.Builder](https://developer.android.com/reference/android/app/Notification.CarExtender.Builder) | this object for method chaining <br /> |

**See also:**

- [Notification.CarExtender.UnreadConversation.getRemoteInput()](https://developer.android.com/reference/android/app/Notification.CarExtender.UnreadConversation#getRemoteInput())
- [Notification.CarExtender.UnreadConversation.getReplyPendingIntent()](https://developer.android.com/reference/android/app/Notification.CarExtender.UnreadConversation#getReplyPendingIntent())