Android 12 Developer Preview is here! Try it out, and give us your feedback!

MessageInfo.Builder

public static final class MessageInfo.Builder
extends Object

java.lang.Object
   ↳ androidx.car.app.navigation.model.MessageInfo.Builder


A builder of MessageInfo.

Summary

Public constructors

Builder(CharSequence title)

Returns a new instance of a MessageInfo.Builder.

Builder(CarText title)

Returns a new instance of a MessageInfo.Builder.

Public methods

MessageInfo build()

Constructs the MessageInfo defined by this builder.

MessageInfo.Builder setImage(CarIcon image)

Sets the image to display along with the message.

MessageInfo.Builder setText(CharSequence text)

Sets additional text on the message.

MessageInfo.Builder setText(CarText text)

Sets additional text on the message.

MessageInfo.Builder setTitle(CharSequence title)

Sets the title of the message.

Inherited methods

Public constructors

Builder

public Builder (CharSequence title)

Returns a new instance of a MessageInfo.Builder.

Parameters
title CharSequence

Throws
NullPointerException if title is null

Builder

public Builder (CarText title)

Returns a new instance of a MessageInfo.Builder.

Parameters
title CarText

Throws
NullPointerException if title is null

Public methods

build

public MessageInfo build ()

Constructs the MessageInfo defined by this builder.

Returns
MessageInfo

setImage

public MessageInfo.Builder setImage (CarIcon image)

Sets the image to display along with the message.

Unless set with this method, the message will not have an image.

Parameters
image CarIcon

Returns
MessageInfo.Builder

Throws
NullPointerException if image is null

setText

public MessageInfo.Builder setText (CharSequence text)

Sets additional text on the message.

Spans are not supported in the input string.

Parameters
text CharSequence

Returns
MessageInfo.Builder

Throws
NullPointerException if text is null

See also:

setText

public MessageInfo.Builder setText (CarText text)

Sets additional text on the message.

Spans are not supported in the input string.

Parameters
text CarText

Returns
MessageInfo.Builder

Throws
NullPointerException if text is null

See also:

setTitle

public MessageInfo.Builder setTitle (CharSequence title)

Sets the title of the message.

Spans are not supported in the input string.

Parameters
title CharSequence

Returns
MessageInfo.Builder

Throws
NullPointerException if message is null

See also: