Google is committed to advancing racial equity for Black communities. See how.

ConversationActions.Message

public static final class ConversationActions.Message
extends Object

java.lang.Object
   ↳ androidx.textclassifier.ConversationActions.Message


Represents a message in the conversation.

Summary

Nested classes

class ConversationActions.Message.Builder

Builder class to construct a ConversationActions.Message  

Fields

public static final Person PERSON_USER_OTHERS

Represents the remote user.

public static final Person PERSON_USER_SELF

Represents the local user.

Public methods

static ConversationActions.Message createFromBundle(Bundle bundle)

Converts a bundle that was created using toBundle() to a ConversationActions.Message.

Person getAuthor()

Returns the person that composed the message.

Bundle getExtras()

Returns the extended data related to this conversation action.

Long getReferenceTime()

Returns the reference time of the message, for example it could be the compose or send time of this message.

CharSequence getText()

Returns the text of the message.

Bundle toBundle()

Adds this object to a Bundle that can be read back with the same parameters to createFromBundle(Bundle).

Inherited methods

Fields

PERSON_USER_OTHERS

public static final Person PERSON_USER_OTHERS

Represents the remote user.

If possible, you are suggested to create a Person object that can identify the remote user better, so that the underlying model could differentiate between different remote users.

PERSON_USER_SELF

public static final Person PERSON_USER_SELF

Represents the local user.

Public methods

createFromBundle

public static ConversationActions.Message createFromBundle (Bundle bundle)

Converts a bundle that was created using toBundle() to a ConversationActions.Message.

Parameters
bundle Bundle

Returns
ConversationActions.Message

getAuthor

public Person getAuthor ()

Returns the person that composed the message.

Returns
Person

getExtras

public Bundle getExtras ()

Returns the extended data related to this conversation action.

NOTE: Each call to this method returns a new bundle copy so clients should prefer to hold a reference to the returned bundle rather than frequently calling this method.

Returns
Bundle

getReferenceTime

public Long getReferenceTime ()

Returns the reference time of the message, for example it could be the compose or send time of this message. This should be milliseconds from the epoch of 1970-01-01T00:00:00Z(UTC timezone). If no reference time or null is set, now is used.

Returns
Long

getText

public CharSequence getText ()

Returns the text of the message.

Returns
CharSequence

toBundle

public Bundle toBundle ()

Adds this object to a Bundle that can be read back with the same parameters to createFromBundle(Bundle).

Returns
Bundle