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

# PickOptionRequest

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/app/VoiceInteractor.PickOptionRequest "View this page in Java")

```
class PickOptionRequest : VoiceInteractor.Request
```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||
| ↳ | [android.app.VoiceInteractor.Request](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Request) ||
|   | ↳ | [android.app.VoiceInteractor.PickOptionRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest#) |

Select a single option from multiple potential options with the user via the trusted system VoiceInteractionService. Typically, the application would present this visually as a list view to allow selecting the option by touch. The result of the confirmation will be returned through an asynchronous call to either `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest#onPickOptionResult(kotlin.Boolean,%20kotlin.Array,%20android.os.Bundle)` or `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Request#onCancel()` - these methods should be overridden to define the application specific behavior.

## Summary

| Nested classes ||
|---|---|
|   | `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.Option` Represents a single option that the user may select using their voice. |

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest#PickOptionRequest(android.app.VoiceInteractor.Prompt,%20kotlin.Array,%20android.os.Bundle)(prompt: https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Prompt?, options: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.Option!>!, extras: https://developer.android.com/reference/kotlin/android/os/Bundle.html#?)` Create a new pick option request. |

| Public methods ||
|---|---|
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest#onPickOptionResult(kotlin.Boolean,%20kotlin.Array,%20android.os.Bundle)(finished: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html, selections: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.Option!>!, result: https://developer.android.com/reference/kotlin/android/os/Bundle.html#!)` Called when a single option is confirmed or narrowed to one of several options. |

| Inherited functions ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Request` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Request#cancel()()` Cancel this active request. <br /> | | `https://developer.android.com/reference/kotlin/android/app/Activity!` | `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Request#getActivity()()` Return the current `https://developer.android.com/reference/kotlin/android/app/Activity` this request is associated with. Will change if the activity is restarted such as through a configuration change. <br /> | | `https://developer.android.com/reference/kotlin/android/content/Context.html#!` | `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Request#getContext()()` Return the current `https://developer.android.com/reference/kotlin/android/content/Context.html#` this request is associated with. May change if the activity hosting it goes through a configuration change. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Request#getName()()` Return the name this request was submitted through `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor#submitRequest(android.app.VoiceInteractor.Request,%20kotlin.String)`. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Request#onAttached(android.app.Activity)(activity: https://developer.android.com/reference/kotlin/android/app/Activity!)` The request is now attached to an activity, or being re-attached to a new activity after a configuration change. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Request#onCancel()()` Report from voice interaction service: this operation has been canceled, typically as a completion of a previous call to `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Request#cancel()` or when the user explicitly cancelled. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Request#onDetached()()` The request is being detached from an activity. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Request#toString()()` Returns a string representation of the object. <br /> | ||

## Public constructors

### PickOptionRequest

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

```
PickOptionRequest(
    prompt: VoiceInteractor.Prompt?, 
    options: Array<VoiceInteractor.PickOptionRequest.Option!>!, 
    extras: Bundle?)
```

Create a new pick option request.

| Parameters ||
|---|---|
| `prompt` | [VoiceInteractor.Prompt](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Prompt)?: Optional question to be asked of the user when the options are presented or null if nothing should be asked. |
| `options` | [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)\<[VoiceInteractor.PickOptionRequest.Option](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.Option)!\>!: The set of `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.Option`s the user is selecting from. |
| `extras` | [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)?: Additional optional information or null. |

## Public methods

### onPickOptionResult

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

```
open fun onPickOptionResult(
    finished: Boolean, 
    selections: Array<VoiceInteractor.PickOptionRequest.Option!>!, 
    result: Bundle!
): Unit
```

Called when a single option is confirmed or narrowed to one of several options. Override this method to define the behavior when the user selects an option or narrows down the set of options.

| Parameters ||
|---|---|
| `finished` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): True if the voice interaction has finished making a selection, in which case `selections` contains the final result. If false, this request is still active and you will continue to get calls on it. |
| `selections` | [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)\<[VoiceInteractor.PickOptionRequest.Option](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.Option)!\>!: Either a single `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.Option` or one of several `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.Option`s the user has narrowed the choices down to. |
| `result` | [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!: Additional optional information. |