ConversationAction
  public
  
  final
  
  class
  ConversationAction
  
    extends Object
  
  
  
  
  
      implements
      
        Parcelable
      
  
  
| java.lang.Object | |
| ↳ | android.view.textclassifier.ConversationAction | 
Represents the action suggested by a TextClassifier on a given conversation.
Summary
Nested classes | |
|---|---|
        
        
        
        
        class | 
      
        ConversationAction.Builder
        Builder class to construct   | 
    
Constants | |
|---|---|
String | 
        
          TYPE_CALL_PHONE
          Indicates an action to call a phone number.  | 
    
String | 
        
          TYPE_CREATE_REMINDER
          Indicates an action to create a reminder.  | 
    
String | 
        
          TYPE_OPEN_URL
          Indicates an action to open an URL.  | 
    
String | 
        
          TYPE_SEND_EMAIL
          Indicates an action to send an email.  | 
    
String | 
        
          TYPE_SEND_SMS
          Indicates an action to send a SMS.  | 
    
String | 
        
          TYPE_SHARE_LOCATION
          Indicates an action to reply with a location.  | 
    
String | 
        
          TYPE_TEXT_REPLY
          Indicates an action to reply with a text message.  | 
    
String | 
        
          TYPE_TRACK_FLIGHT
          Indicates an action to track a flight.  | 
    
String | 
        
          TYPE_VIEW_CALENDAR
          Indicates an action to view a calendar at a specified time.  | 
    
String | 
        
          TYPE_VIEW_MAP
          Indicates an action to view the map at a specified location.  | 
    
Inherited constants | 
|---|
Fields | |
|---|---|
    public
    static
    final
    Creator<ConversationAction> | 
    
      CREATOR
      
  | 
  
Public methods | |
|---|---|
        
        
        
        
        
        int
     | 
  
    
      
      describeContents()
      
      
        Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.  | 
  
        
        
        
        
        
        RemoteAction
     | 
  
    
      
      getAction()
      
      
        Returns a RemoteAction object, which contains the icon, label and a PendingIntent, for the specified action type.  | 
  
        
        
        
        
        
        float
     | 
  
    
      
      getConfidenceScore()
      
      
        Returns the confidence score for the specified action.  | 
  
        
        
        
        
        
        Bundle
     | 
  
    
      
      getExtras()
      
      
        Returns the extended data related to this conversation action.  | 
  
        
        
        
        
        
        CharSequence
     | 
  
    
      
      getTextReply()
      
      
        Returns the text reply that could be sent as a reply to the given conversation.  | 
  
        
        
        
        
        
        String
     | 
  
    
      
      getType()
      
      
        Returns the type of this action, for example,   | 
  
        
        
        
        
        
        void
     | 
  
    
      
      writeToParcel(Parcel parcel, int flags)
      
      
        Flatten this object in to a Parcel.  | 
  
Inherited methods | |
|---|---|
Constants
TYPE_CALL_PHONE
public static final String TYPE_CALL_PHONE
Indicates an action to call a phone number.
Constant Value: "call_phone"
TYPE_CREATE_REMINDER
public static final String TYPE_CREATE_REMINDER
Indicates an action to create a reminder.
Constant Value: "create_reminder"
TYPE_OPEN_URL
public static final String TYPE_OPEN_URL
Indicates an action to open an URL.
Constant Value: "open_url"
TYPE_SEND_EMAIL
public static final String TYPE_SEND_EMAIL
Indicates an action to send an email.
Constant Value: "send_email"
TYPE_SEND_SMS
public static final String TYPE_SEND_SMS
Indicates an action to send a SMS.
Constant Value: "send_sms"
TYPE_SHARE_LOCATION
public static final String TYPE_SHARE_LOCATION
Indicates an action to reply with a location.
Constant Value: "share_location"
TYPE_TEXT_REPLY
public static final String TYPE_TEXT_REPLY
Indicates an action to reply with a text message.
Constant Value: "text_reply"
TYPE_TRACK_FLIGHT
public static final String TYPE_TRACK_FLIGHT
Indicates an action to track a flight.
Constant Value: "track_flight"
TYPE_VIEW_CALENDAR
public static final String TYPE_VIEW_CALENDAR
Indicates an action to view a calendar at a specified time.
Constant Value: "view_calendar"
TYPE_VIEW_MAP
public static final String TYPE_VIEW_MAP
Indicates an action to view the map at a specified location.
Constant Value: "view_map"
Fields
Public methods
describeContents
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
 instance's marshaled representation. For example, if the object will
 include a file descriptor in the output of writeToParcel(android.os.Parcel, int),
 the return value of this method must include the
 CONTENTS_FILE_DESCRIPTOR bit.
| Returns | |
|---|---|
int | 
        a bitmask indicating the set of special object types marshaled
 by this Parcelable object instance.
 Value is either 0 or CONTENTS_FILE_DESCRIPTOR | 
      
getAction
public RemoteAction getAction ()
Returns a RemoteAction object, which contains the icon, label and a PendingIntent, for the specified action type.
| Returns | |
|---|---|
RemoteAction | 
        This value may be null. | 
      
getConfidenceScore
public float getConfidenceScore ()
Returns the confidence score for the specified action. The value ranges from 0 (low confidence) to 1 (high confidence).
| Returns | |
|---|---|
float | 
        Value is between 0.0f and 1.0f inclusive | 
getExtras
public Bundle getExtras ()
Returns the extended data related to this conversation action.
NOTE: Do not modify this bundle.
| Returns | |
|---|---|
Bundle | 
        This value cannot be null. | 
      
getTextReply
public CharSequence getTextReply ()
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.
| Returns | |
|---|---|
CharSequence | 
        This value may be null. | 
      
getType
public String getType ()
Returns the type of this action, for example, TYPE_VIEW_CALENDAR.
| Returns | |
|---|---|
String | 
        This value cannot be null.
 Value is TYPE_VIEW_CALENDAR, TYPE_VIEW_MAP, TYPE_TRACK_FLIGHT, TYPE_OPEN_URL, TYPE_SEND_SMS, TYPE_CALL_PHONE, TYPE_SEND_EMAIL, TYPE_TEXT_REPLY, TYPE_CREATE_REMINDER, or TYPE_SHARE_LOCATION | 
      
writeToParcel
public void writeToParcel (Parcel parcel, int flags)
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
parcel | 
        
          Parcel: 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.PARCELABLE_WRITE_RETURN_VALUE.
 Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES | 
      
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.