NotificationCompat.CarExtender.UnreadConversation.Builder

Added in 1.1.0
Deprecated in 1.3.0

public class NotificationCompat.CarExtender.UnreadConversation.Builder


Builder class for CarExtender.UnreadConversation objects.

Summary

Public constructors

Constructs a new builder for CarExtender.UnreadConversation.

Public methods

@NonNull NotificationCompat.CarExtender.UnreadConversation.Builder

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

@NonNull NotificationCompat.CarExtender.UnreadConversation

Builds a new unread conversation object.

@NonNull NotificationCompat.CarExtender.UnreadConversation.Builder
setLatestTimestamp(long timestamp)

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

@NonNull NotificationCompat.CarExtender.UnreadConversation.Builder

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

@NonNull NotificationCompat.CarExtender.UnreadConversation.Builder
setReplyAction(
    @Nullable PendingIntent pendingIntent,
    @Nullable RemoteInput remoteInput
)

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

Public constructors

Builder

Added in 1.1.0
Deprecated in 1.3.0
public Builder(@NonNull String name)

Constructs a new builder for CarExtender.UnreadConversation.

Parameters
@NonNull String name

The name of the other participant in the conversation.

Public methods

addMessage

Added in 1.1.0
Deprecated in 1.3.0
public @NonNull NotificationCompat.CarExtender.UnreadConversation.Builder addMessage(@Nullable String message)

Appends a new unread message to the list of messages for this conversation. The messages should be added from oldest to newest.

Parameters
@Nullable String message

The text of the new unread message.

Returns
@NonNull NotificationCompat.CarExtender.UnreadConversation.Builder

This object for method chaining.

build

Added in 1.1.0
Deprecated in 1.3.0
public @NonNull NotificationCompat.CarExtender.UnreadConversation build()

Builds a new unread conversation object.

Returns
@NonNull NotificationCompat.CarExtender.UnreadConversation

The new unread conversation object.

setLatestTimestamp

Added in 1.1.0
Deprecated in 1.3.0
public @NonNull NotificationCompat.CarExtender.UnreadConversation.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.

Parameters
long timestamp

The timestamp of the most recent message in the conversation.

Returns
@NonNull NotificationCompat.CarExtender.UnreadConversation.Builder

This object for method chaining.

setReadPendingIntent

Added in 1.1.0
Deprecated in 1.3.0
public @NonNull NotificationCompat.CarExtender.UnreadConversation.Builder setReadPendingIntent(@Nullable PendingIntent pendingIntent)

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

Parameters
@Nullable PendingIntent pendingIntent

The pending intent to use.

Returns
@NonNull NotificationCompat.CarExtender.UnreadConversation.Builder

This object for method chaining.

setReplyAction

Added in 1.1.0
Deprecated in 1.3.0
public @NonNull NotificationCompat.CarExtender.UnreadConversation.Builder setReplyAction(
    @Nullable PendingIntent pendingIntent,
    @Nullable RemoteInput remoteInput
)

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

Parameters
@Nullable PendingIntent pendingIntent

The pending intent which will be triggered on a reply.

@Nullable RemoteInput remoteInput

The remote input parcelable which will carry the reply.

Returns
@NonNull NotificationCompat.CarExtender.UnreadConversation.Builder

This object for method chaining.