ConversationActions.Message

class ConversationActions.Message


Represents a message in the conversation.

Summary

Nested types

This class is deprecated.

Use android.view.textclassifier.ConversationAction.Builder instead.

Constants

const Person

Represents the remote user.

const Person

Represents the local user.

Public functions

java-static ConversationActions.Message

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

Person

Returns the person that composed the message.

Bundle

Returns the extended data related to this conversation action.

Long?

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

CharSequence?

Returns the text of the message.

Bundle

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

Constants

PERSON_USER_OTHERS

const val PERSON_USER_OTHERSPerson

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

const val PERSON_USER_SELFPerson

Represents the local user.

Public functions

createFromBundle

java-static fun createFromBundle(bundle: Bundle): ConversationActions.Message

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

getAuthor

fun getAuthor(): Person

Returns the person that composed the message.

getExtras

fun getExtras(): Bundle

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.

getReferenceTime

fun getReferenceTime(): Long?

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.

getText

fun getText(): CharSequence?

Returns the text of the message.

toBundle

fun toBundle(): Bundle

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