class ConversationAction


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

Summary

Nested types

This class is deprecated.

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

Constants

const String!
TYPE_ADD_CONTACT = "add_contact"

Indicates an action to add a contact.

const String!
TYPE_CALL_PHONE = "call_phone"

Indicates an action to call a phone number.

const String!
TYPE_COPY = "copy"

Indicates an action to copy a code.

const String!
TYPE_CREATE_REMINDER = "create_reminder"

Indicates an action to create a reminder.

const String!
TYPE_OPEN_URL = "open_url"

Indicates an action to open an URL.

const String!
TYPE_SEND_EMAIL = "send_email"

Indicates an action to send an email.

const String!
TYPE_SEND_SMS = "send_sms"

Indicates an action to send a SMS.

const String!
TYPE_SHARE_LOCATION = "share_location"

Indicates an action to reply with a location.

const String!
TYPE_TEXT_REPLY = "text_reply"

Indicates an action to reply with a text message.

const String!
TYPE_TRACK_FLIGHT = "track_flight"

Indicates an action to track a flight.

const String!
TYPE_VIEW_CALENDAR = "view_calendar"

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

const String!
TYPE_VIEW_MAP = "view_map"

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

Public functions

java-static ConversationAction

Converts a bundle that was created using toBundle to a ConversationAction.

RemoteActionCompat?

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

@FloatRange(from = 0, to = 1) 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.

Bundle

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

Constants

TYPE_ADD_CONTACT

const val TYPE_ADD_CONTACT = "add_contact": String!

Indicates an action to add a contact.

TYPE_CALL_PHONE

const val TYPE_CALL_PHONE = "call_phone": String!

Indicates an action to call a phone number.

TYPE_COPY

const val TYPE_COPY = "copy": String!

Indicates an action to copy a code.

TYPE_CREATE_REMINDER

const val TYPE_CREATE_REMINDER = "create_reminder": String!

Indicates an action to create a reminder.

TYPE_OPEN_URL

const val TYPE_OPEN_URL = "open_url": String!

Indicates an action to open an URL.

TYPE_SEND_EMAIL

const val TYPE_SEND_EMAIL = "send_email": String!

Indicates an action to send an email.

TYPE_SEND_SMS

const val TYPE_SEND_SMS = "send_sms": String!

Indicates an action to send a SMS.

TYPE_SHARE_LOCATION

const val TYPE_SHARE_LOCATION = "share_location": String!

Indicates an action to reply with a location.

TYPE_TEXT_REPLY

const val TYPE_TEXT_REPLY = "text_reply": String!

Indicates an action to reply with a text message.

TYPE_TRACK_FLIGHT

const val TYPE_TRACK_FLIGHT = "track_flight": String!

Indicates an action to track a flight.

TYPE_VIEW_CALENDAR

const val TYPE_VIEW_CALENDAR = "view_calendar": String!

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

TYPE_VIEW_MAP

const val TYPE_VIEW_MAP = "view_map": String!

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

Public functions

createFromBundle

java-static fun createFromBundle(bundle: Bundle): ConversationAction

Converts a bundle that was created using toBundle to a ConversationAction.

getAction

fun getAction(): RemoteActionCompat?

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

getConfidenceScore

fun getConfidenceScore(): @FloatRange(from = 0, to = 1) Float

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

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.

getTextReply

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.

getType

fun getType(): String

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

toBundle

fun toBundle(): Bundle

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