Added in API level 29

ConversationAction


class ConversationAction : Parcelable
kotlin.Any
   ↳ android.view.textclassifier.ConversationAction

Represents the action suggested by a TextClassifier on a given conversation.

Summary

Nested classes

Builder class to construct ConversationAction.

Constants
static String

Indicates an action to call a phone number.

static String

Indicates an action to create a reminder.

static String

Indicates an action to open an URL.

static String

Indicates an action to send an email.

static String

Indicates an action to send a SMS.

static String

Indicates an action to reply with a location.

static String

Indicates an action to reply with a text message.

static String

Indicates an action to track a flight.

static String

Indicates an action to view a calendar at a specified time.

static String

Indicates an action to view the map at a specified location.

Inherited constants
Public methods
Int

RemoteAction?

Returns a RemoteAction object, which contains the icon, label and a PendingIntent, for the specified action type.

Float

Returns the confidence score for the specified action.

Bundle

Returns the extended data related to this conversation action.

CharSequence?

Returns the text reply that could be sent as a reply to the given conversation.

String

Returns the type of this action, for example, TYPE_VIEW_CALENDAR.

Unit
writeToParcel(parcel: Parcel, flags: Int)

Properties
static Parcelable.Creator<ConversationAction!>

Constants

TYPE_CALL_PHONE

Added in API level 29
static val TYPE_CALL_PHONE: String

Indicates an action to call a phone number.

Value: "call_phone"

TYPE_CREATE_REMINDER

Added in API level 29
static val TYPE_CREATE_REMINDER: String

Indicates an action to create a reminder.

Value: "create_reminder"

TYPE_OPEN_URL

Added in API level 29
static val TYPE_OPEN_URL: String

Indicates an action to open an URL.

Value: "open_url"

TYPE_SEND_EMAIL

Added in API level 29
static val TYPE_SEND_EMAIL: String

Indicates an action to send an email.

Value: "send_email"

TYPE_SEND_SMS

Added in API level 29
static val TYPE_SEND_SMS: String

Indicates an action to send a SMS.

Value: "send_sms"

TYPE_SHARE_LOCATION

Added in API level 29
static val TYPE_SHARE_LOCATION: String

Indicates an action to reply with a location.

Value: "share_location"

TYPE_TEXT_REPLY

Added in API level 29
static val TYPE_TEXT_REPLY: String

Indicates an action to reply with a text message.

Value: "text_reply"

TYPE_TRACK_FLIGHT

Added in API level 29
static val TYPE_TRACK_FLIGHT: String

Indicates an action to track a flight.

Value: "track_flight"

TYPE_VIEW_CALENDAR

Added in API level 29
static val TYPE_VIEW_CALENDAR: String

Indicates an action to view a calendar at a specified time.

Value: "view_calendar"

TYPE_VIEW_MAP

Added in API level 29
static val TYPE_VIEW_MAP: String

Indicates an action to view the map at a specified location.

Value: "view_map"

Public methods

describeContents

Added in API level 29
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getAction

Added in API level 29
fun getAction(): RemoteAction?

Returns a RemoteAction object, which contains the icon, label and a PendingIntent, for the specified action type.

Return
RemoteAction? This value may be null.

getConfidenceScore

Added in API level 29
fun getConfidenceScore(): Float

Returns the confidence score for the specified action. The value ranges from 0 (low confidence) to 1 (high confidence).

Return
Float Value is between 0 and 1 inclusive

getExtras

Added in API level 29
fun getExtras(): Bundle

Returns the extended data related to this conversation action.

NOTE: Do not modify this bundle.

Return
Bundle This value cannot be null.

getTextReply

Added in API level 29
fun getTextReply(): CharSequence?

Returns the text reply that could be sent as a reply to the given conversation.

This is only available when the type of the action is TYPE_TEXT_REPLY.

Return
CharSequence? This value may be null.

writeToParcel

Added in API level 29
fun writeToParcel(
    parcel: Parcel,
    flags: Int
): Unit
Parameters
dest The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 29
static val CREATOR: Parcelable.Creator<ConversationAction!>