public final class

ConversationActions.Message

extends java.lang.Object

 java.lang.Object

↳androidx.textclassifier.ConversationActions.Message

Overview

Represents a message in the conversation.

Summary

Fields
public static final PersonPERSON_USER_OTHERS

Represents the remote user.

public static final PersonPERSON_USER_SELF

Represents the local user.

Methods
public static ConversationActions.MessagecreateFromBundle(Bundle bundle)

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

public PersongetAuthor()

Returns the person that composed the message.

public BundlegetExtras()

Returns the extended data related to this conversation action.

public java.lang.LonggetReferenceTime()

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

public java.lang.CharSequencegetText()

Returns the text of the message.

public BundletoBundle()

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final Person PERSON_USER_SELF

Represents the local user.

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.

Methods

public Person getAuthor()

Returns the person that composed the message.

public java.lang.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.

public java.lang.CharSequence getText()

Returns the text of the message.

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.

public Bundle toBundle()

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

public static ConversationActions.Message createFromBundle(Bundle bundle)

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