Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/view/textclassifier/ConversationAction#nestedclasses) \| [Constants](https://developer.android.com/reference/android/view/textclassifier/ConversationAction#constants) \| [Inherited Constants](https://developer.android.com/reference/android/view/textclassifier/ConversationAction#inhconstants) \| [Fields](https://developer.android.com/reference/android/view/textclassifier/ConversationAction#lfields) \| [Methods](https://developer.android.com/reference/android/view/textclassifier/ConversationAction#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/view/textclassifier/ConversationAction#inhmethods)

# ConversationAction

*** ** * ** ***

` public final class ConversationAction `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.textclassifier.ConversationAction |

<br />

*** ** * ** ***

Represents the action suggested by a `https://developer.android.com/reference/android/view/textclassifier/TextClassifier` on a given conversation.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/view/textclassifier/ConversationAction.Builder` Builder class to construct `https://developer.android.com/reference/android/view/textclassifier/ConversationAction`. |

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_CALL_PHONE` Indicates an action to call a phone number. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_CREATE_REMINDER` Indicates an action to create a reminder. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_OPEN_URL` Indicates an action to open an URL. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_SEND_EMAIL` Indicates an action to send an email. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_SEND_SMS` Indicates an action to send a SMS. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_SHARE_LOCATION` Indicates an action to reply with a location. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_TEXT_REPLY` Indicates an action to reply with a text message. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_TRACK_FLIGHT` Indicates an action to track a flight. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_VIEW_CALENDAR` Indicates an action to view a calendar at a specified time. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_VIEW_MAP` Indicates an action to view the map at a specified location. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`".

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/view/textclassifier/ConversationAction>` | `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#CREATOR` <br /> |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/view/textclassifier/ConversationAction#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` https://developer.android.com/reference/android/app/RemoteAction` | ` https://developer.android.com/reference/android/view/textclassifier/ConversationAction#getAction()() ` Returns a RemoteAction object, which contains the icon, label and a PendingIntent, for the specified action type. |
| ` float` | ` https://developer.android.com/reference/android/view/textclassifier/ConversationAction#getConfidenceScore()() ` Returns the confidence score for the specified action. |
| ` https://developer.android.com/reference/android/os/Bundle` | ` https://developer.android.com/reference/android/view/textclassifier/ConversationAction#getExtras()() ` Returns the extended data related to this conversation action. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/view/textclassifier/ConversationAction#getTextReply()() ` Returns the text reply that could be sent as a reply to the given conversation. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/view/textclassifier/ConversationAction#getType()() ` Returns the type of this action, for example, `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_VIEW_CALENDAR`. |
| ` void` | ` https://developer.android.com/reference/android/view/textclassifier/ConversationAction#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel parcel, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Constants

### TYPE_CALL_PHONE

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String TYPE_CALL_PHONE
```

Indicates an action to call a phone number.

<br />

Constant Value: "call_phone"

### TYPE_CREATE_REMINDER

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String TYPE_CREATE_REMINDER
```

Indicates an action to create a reminder.

<br />

Constant Value: "create_reminder"

### TYPE_OPEN_URL

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String TYPE_OPEN_URL
```

Indicates an action to open an URL.

<br />

Constant Value: "open_url"

### TYPE_SEND_EMAIL

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String TYPE_SEND_EMAIL
```

Indicates an action to send an email.

<br />

Constant Value: "send_email"

### TYPE_SEND_SMS

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String TYPE_SEND_SMS
```

Indicates an action to send a SMS.

<br />

Constant Value: "send_sms"

### TYPE_SHARE_LOCATION

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String TYPE_SHARE_LOCATION
```

Indicates an action to reply with a location.

<br />

Constant Value: "share_location"

### TYPE_TEXT_REPLY

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String TYPE_TEXT_REPLY
```

Indicates an action to reply with a text message.

<br />

Constant Value: "text_reply"

### TYPE_TRACK_FLIGHT

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String TYPE_TRACK_FLIGHT
```

Indicates an action to track a flight.

<br />

Constant Value: "track_flight"

### TYPE_VIEW_CALENDAR

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String TYPE_VIEW_CALENDAR
```

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

<br />

Constant Value: "view_calendar"

### TYPE_VIEW_MAP

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String TYPE_VIEW_MAP
```

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

<br />

Constant Value: "view_map"

## Fields

### CREATOR

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<ConversationAction> CREATOR
```

<br />

<br />

## Public methods

### describeContents

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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 `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`, the return value of this method must include the `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getAction

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public RemoteAction getAction ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/RemoteAction` | This value may be `null`. <br /> |

### getConfidenceScore

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getConfidenceScore ()
```

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

<br />

| Returns ||
|---|---|
| `float` | Value is between 0.0f and 1.0f inclusive <br /> |

### getExtras

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Bundle getExtras ()
```

Returns the extended data related to this conversation action.

**NOTE:**Do not modify this bundle.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Bundle` | This value cannot be `null`. <br /> |

### getTextReply

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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 `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_TEXT_REPLY`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | This value may be `null`. <br /> |

### getType

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getType ()
```

Returns the type of this action, for example, `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_VIEW_CALENDAR`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. Value is one of the following: - `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_VIEW_CALENDAR` - `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_VIEW_MAP` - `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_TRACK_FLIGHT` - `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_OPEN_URL` - `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_SEND_SMS` - `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_CALL_PHONE` - `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_SEND_EMAIL` - `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_TEXT_REPLY` - `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_CREATE_REMINDER` - `https://developer.android.com/reference/android/view/textclassifier/ConversationAction#TYPE_SHARE_LOCATION` |

### writeToParcel

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel parcel, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `parcel` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |