# RemoteInputIntentHelper

Artifact: [androidx.wear:wear-input](https://developer.android.com/jetpack/androidx/releases/wear) [View Source](https://cs.android.com/search?q=file:androidx/wear/input/RemoteInputIntentHelper.kt+class:androidx.wear.input.RemoteInputIntentHelper) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

*** ** * ** ***

<br />

```
class RemoteInputIntentHelper
```

<br />

*** ** * ** ***

Helper functions for supporting remote inputs through starting an `https://developer.android.com/reference/android/content/Intent.html`.

The following example prompts the user to provide input for one `RemoteInput` by starting an input activity.

```kotlin
public const val KEY_QUICK_REPLY_TEXT: String = "quick_reply";
val remoteInputs: List<RemoteInput> = listOf(
    new RemoteInput.Builder(KEY_QUICK_REPLY_TEXT).setLabel("Quick reply").build()
);
val intent: Intent = createActionRemoteInputIntent();
putRemoteInputsExtra(intent, remoteInputs)
startActivityForResult(intent);
```

The intent returned via `https://developer.android.com/reference/android/app/Activity.html#onActivityResult(int, int, android.content.Intent)` will contain the input results if collected, for example:

```kotlin
override fun onActivityResult(requestCode: Int, resultCode: Int, intentResults: Intent?) {
    val results: Bundle = RemoteInput.getResultsFromIntent(intentResults)
    val quickReplyResult: CharSequence? = results.getCharSequence(KEY_QUICK_REPLY_TEXT)
}
```

More information about accessing these results can be found in `https://developer.android.com/reference/android/app/RemoteInput.html`.

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#createActionRemoteInputIntent()()` Create an intent with action for remote input. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#getCancelLabelExtra(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Returns the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` from the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed to cancel the action. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#getConfirmLabelExtra(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Returns the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` from the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed to confirm that the action should be executed. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#getInProgressLabelExtra(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Returns the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` from the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed while the wearable is preparing to automatically execute the action. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/app/RemoteInput.html>?` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#getRemoteInputsExtra(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Returns the array of `https://developer.android.com/reference/android/app/RemoteInput.html` from the given `https://developer.android.com/reference/android/content/Intent.html` that specifies inputs to be collected from a user. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html>?` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#getSmartReplyContextExtra(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Returns the array of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` from the given `https://developer.android.com/reference/android/content/Intent.html` that provides context for creating Smart Reply choices within a RemoteInput session. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#getTitleExtra(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Returns the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` from the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed on top of the confirmation screen to describe the action. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#hasRemoteInputsExtra(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Checks whether the given `https://developer.android.com/reference/android/content/Intent.html` has extra for the array of `https://developer.android.com/reference/android/app/RemoteInput.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#isActionRemoteInput(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Checks whether the action of the given intent is for remote input. |
| `https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putCancelLabelExtra(android.content.Intent,kotlin.CharSequence)(intent: https://developer.android.com/reference/android/content/Intent.html, label: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)` Adds the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` to the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed to cancel the action. |
| `https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putConfirmLabelExtra(android.content.Intent,kotlin.CharSequence)(intent: https://developer.android.com/reference/android/content/Intent.html, label: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)` Adds the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` to the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed to confirm that the action should be executed. |
| `https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putInProgressLabelExtra(android.content.Intent,kotlin.CharSequence)(intent: https://developer.android.com/reference/android/content/Intent.html, label: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)` Adds the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` to the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed while the wearable is preparing to automatically execute the action. |
| `https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putRemoteInputsExtra(android.content.Intent,kotlin.collections.List)(intent: https://developer.android.com/reference/android/content/Intent.html, remoteInputs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/app/RemoteInput.html>)` Adds the array of `https://developer.android.com/reference/android/app/RemoteInput.html` to the given `https://developer.android.com/reference/android/content/Intent.html` that specifies inputs collected from a user. |
| `https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putSmartReplyContextExtra(android.content.Intent,kotlin.collections.List)( intent: https://developer.android.com/reference/android/content/Intent.html, smartReplyContext: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html> )` Adds the array of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` to the given `https://developer.android.com/reference/android/content/Intent.html` that provides context for creating Smart Reply choices within a RemoteInput session. |
| `https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putTitleExtra(android.content.Intent,kotlin.CharSequence)(intent: https://developer.android.com/reference/android/content/Intent.html, title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)` Adds the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` to the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed on top of the confirmation screen to describe the action like "SMS" or "Email". |

## Public companion functions

### createActionRemoteInputIntent

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun createActionRemoteInputIntent(): Intent
```

Create an intent with action for remote input. This intent can be used to start an activity that will prompt the user for input. With the other helpers in this class to specify the intent extras, we can configure the behaviour of the input activity, such as specifying input be collected from a user by populating with an array of `https://developer.android.com/reference/android/app/RemoteInput.html` with `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putRemoteInputsExtra(android.content.Intent,kotlin.collections.List)`.

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html` | The created intent with action for remote input. |

### getCancelLabelExtra

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun getCancelLabelExtra(intent: Intent): CharSequence?
```

Returns the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` from the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed to cancel the action.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The intent with given data. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | The CharSequence previously added with `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putCancelLabelExtra(android.content.Intent,kotlin.CharSequence)` or null if no value is found. |

### getConfirmLabelExtra

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun getConfirmLabelExtra(intent: Intent): CharSequence?
```

Returns the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` from the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed to confirm that the action should be executed.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The intent with given data. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | The CharSequence previously added with `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putConfirmLabelExtra(android.content.Intent,kotlin.CharSequence)` or null if no value is found. |

### getInProgressLabelExtra

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun getInProgressLabelExtra(intent: Intent): CharSequence?
```

Returns the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` from the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed while the wearable is preparing to automatically execute the action.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The intent with given data. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | The CharSequence previously added with `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putInProgressLabelExtra(android.content.Intent,kotlin.CharSequence)` or null if no value is found. |

### getRemoteInputsExtra

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun getRemoteInputsExtra(intent: Intent): List<RemoteInput>?
```

Returns the array of `https://developer.android.com/reference/android/app/RemoteInput.html` from the given `https://developer.android.com/reference/android/content/Intent.html` that specifies inputs to be collected from a user. Should be used with `https://developer.android.com/reference/android/content/Intent.html` created with .createActionRemoteInputIntent.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The intent with given data. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/app/RemoteInput.html>?` | The array of `https://developer.android.com/reference/android/app/RemoteInput.html` previously added with `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putRemoteInputsExtra(android.content.Intent,kotlin.collections.List)` or null which means no user input required. |

### getSmartReplyContextExtra

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun getSmartReplyContextExtra(intent: Intent): List<CharSequence>?
```

Returns the array of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` from the given `https://developer.android.com/reference/android/content/Intent.html` that provides context for creating Smart Reply choices within a RemoteInput session.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The intent with given data. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html>?` | The array of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` previously added with `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putSmartReplyContextExtra(android.content.Intent,kotlin.collections.List)` or `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putSmartReplyContextExtra(android.content.Intent,kotlin.collections.List)` or null if no value is found. |

### getTitleExtra

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun getTitleExtra(intent: Intent): CharSequence?
```

Returns the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` from the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed on top of the confirmation screen to describe the action.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The intent with given data. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | The CharSequence previously added with `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#putTitleExtra(android.content.Intent,kotlin.CharSequence)` or null if no value is found. |

### hasRemoteInputsExtra

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun hasRemoteInputsExtra(intent: Intent): Boolean
```

Checks whether the given `https://developer.android.com/reference/android/content/Intent.html` has extra for the array of `https://developer.android.com/reference/android/app/RemoteInput.html`.

### isActionRemoteInput

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun isActionRemoteInput(intent: Intent): Boolean
```

Checks whether the action of the given intent is for remote input.

### putCancelLabelExtra

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun putCancelLabelExtra(intent: Intent, label: CharSequence): Intent
```

Adds the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` to the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed to cancel the action. This is usually an imperative verb, like "Cancel". Defaults to Cancel.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The intent with given data. |
| `label: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | The CharSequence to be added. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html` | The given intent. |

### putConfirmLabelExtra

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun putConfirmLabelExtra(intent: Intent, label: CharSequence): Intent
```

Adds the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` to the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed to confirm that the action should be executed. This is usually an imperative verb like "Send". Defaults to "Send".

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The intent with given data. |
| `label: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | The CharSequence to be added. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html` | The given intent. |

### putInProgressLabelExtra

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun putInProgressLabelExtra(intent: Intent, label: CharSequence): Intent
```

Adds the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` to the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed while the wearable is preparing to automatically execute the action. This is usually a 'ing' verb ending in ellipsis like "Sending...". Defaults to "Sending...".

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The intent with given data. |
| `label: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | The CharSequence to be added. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html` | The given intent. |

### putRemoteInputsExtra

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun putRemoteInputsExtra(intent: Intent, remoteInputs: List<RemoteInput>): Intent
```

Adds the array of `https://developer.android.com/reference/android/app/RemoteInput.html` to the given `https://developer.android.com/reference/android/content/Intent.html` that specifies inputs collected from a user. Should be used with `https://developer.android.com/reference/android/content/Intent.html` created with `https://developer.android.com/reference/kotlin/androidx/wear/input/RemoteInputIntentHelper#createActionRemoteInputIntent()`.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The intent with given data. |
| `remoteInputs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/app/RemoteInput.html>` | The array of `https://developer.android.com/reference/android/app/RemoteInput.html` to be added. |

### putSmartReplyContextExtra

```
fun putSmartReplyContextExtra(
    intent: Intent,
    smartReplyContext: List<CharSequence>
): Intent
```

Adds the array of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` to the given `https://developer.android.com/reference/android/content/Intent.html` that provides context for creating Smart Reply choices within a RemoteInput session. The context should be incoming chat messages that a user will reply to using RemoteInput. Only incoming messages (messages from other users) should be passed via this extra.

The messages should be in the order that they were received with the newest messages at the highest index of the CharSequence\[\]. For example, a possible value for this extra would be: "hey", "where are you?". In this case, "where are you?" was the most recently received message.

Passing a chat context into RemoteInput using this method does not guarantee that Smart Reply choices will be shown to a user.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The intent with given data. |
| `smartReplyContext: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html>` | The string to be added. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html` | The given intent. |

### putTitleExtra

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

```
fun putTitleExtra(intent: Intent, title: CharSequence): Intent
```

Adds the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` to the given `https://developer.android.com/reference/android/content/Intent.html` that specifies what is displayed on top of the confirmation screen to describe the action like "SMS" or "Email".

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | The intent with given data. |
| `title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | The CharSequence to be added. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html` | The given intent. |