# VoiceInteractionSession.PickOptionRequest

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/service/voice/VoiceInteractionSession.PickOptionRequest "View this page in Java")  

```
class PickOptionRequest : VoiceInteractionSession.Request
```

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

A request for the user to pick from a set of option, as per[VoiceInteractor.PickOptionRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.html#).

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [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.html#)!\>! | [getOptions](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.PickOptionRequest#getOptions())`()` Return the set of options the user is picking from, as per[VoiceInteractor.PickOptionRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.html#).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)?                                                                                                                                            | [getPrompt](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.PickOptionRequest#getPrompt())`()` Return the prompt informing the user of what they are picking, as per[VoiceInteractor.PickOptionRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.html#).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [VoiceInteractor.Prompt](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Prompt.html#)?                                                                                                                        | [getVoicePrompt](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.PickOptionRequest#getVoicePrompt())`()` Return the prompt informing the user of what they are picking, as per[VoiceInteractor.PickOptionRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.html#).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                              | [sendIntermediatePickOptionResult](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.PickOptionRequest#sendIntermediatePickOptionResult(kotlin.Array,%20android.os.Bundle))`(`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.html#)!>!`, `result:` `[Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!`)` Report an intermediate option selection from the request, without completing it (the request is still active and the app is waiting for the final option selection), resulting in a call to[VoiceInteractor.PickOptionRequest.onPickOptionResult](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.html#onPickOptionResult(kotlin.Boolean,%20kotlin.Array,%20android.os.Bundle))with false for finished. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                              | [sendPickOptionResult](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.PickOptionRequest#sendPickOptionResult(kotlin.Array,%20android.os.Bundle))`(`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.html#)!>!`, `result:` `[Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!`)` Report the final option selection for the request, completing the request and resulting in a call to[VoiceInteractor.PickOptionRequest.onPickOptionResult](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.html#onPickOptionResult(kotlin.Boolean,%20kotlin.Array,%20android.os.Bundle))with false for finished.                                                                                                                |

| Inherited functions ||
|---|---|
| From class[Request](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request) |------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)       | [cancel](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#cancel())`()` <br /> Ask the app to cancel this current request. This also finishes the request (it is no longer active). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!  | [getCallingPackage](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#getCallingPackage())`()` <br /> Return the package name of the application that initiated the request. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [getCallingUid](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#getCallingUid())`()` <br /> Return the uid of the application that initiated the request. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!  | [getExtras](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#getExtras())`()` <br /> Return any additional extra information that was supplied as part of the request. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isActive](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#isActive())`()` <br /> Check whether this request is currently active. A request becomes inactive after calling[cancel](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#cancel())or a final result method that completes the request. After this point, further interactions with the request will result in[java.lang.IllegalStateException](https://developer.android.com/reference/kotlin/java/lang/IllegalStateException.html#)errors; you should not catch these errors, but can use this method if you need to determine the state of the request. Returns true if the request is still active. <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)   | [toString](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#toString())`()` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | ||

## Public methods

### getOptions

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

```
fun getOptions(): Array<VoiceInteractor.PickOptionRequest.Option!>!
```

Return the set of options the user is picking from, as per[VoiceInteractor.PickOptionRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.html#).  

### getPrompt

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

```
fun getPrompt(): CharSequence?
```

**Deprecated:** *Prefer[getVoicePrompt()](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.PickOptionRequest#getVoicePrompt())which allows multiple voice prompts.*

Return the prompt informing the user of what they are picking, as per[VoiceInteractor.PickOptionRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.html#).

|                                                          Return                                                          ||
|------------------------------------------------------------------------------------------------|--------------------------|
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)? | This value may be`null`. |

### getVoicePrompt

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

```
fun getVoicePrompt(): VoiceInteractor.Prompt?
```

Return the prompt informing the user of what they are picking, as per[VoiceInteractor.PickOptionRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.html#).

|                                                                    Return                                                                    ||
|--------------------------------------------------------------------------------------------------------------------|--------------------------|
| [VoiceInteractor.Prompt](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Prompt.html#)? | This value may be`null`. |

### sendIntermediatePickOptionResult

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

```
fun sendIntermediatePickOptionResult(
    selections: Array<VoiceInteractor.PickOptionRequest.Option!>!, 
    result: Bundle!
): Unit
```

Report an intermediate option selection from the request, without completing it (the request is still active and the app is waiting for the final option selection), resulting in a call to[VoiceInteractor.PickOptionRequest.onPickOptionResult](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.html#onPickOptionResult(kotlin.Boolean,%20kotlin.Array,%20android.os.Bundle))with false for finished.  

### sendPickOptionResult

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

```
fun sendPickOptionResult(
    selections: Array<VoiceInteractor.PickOptionRequest.Option!>!, 
    result: Bundle!
): Unit
```

Report the final option selection for the request, completing the request and resulting in a call to[VoiceInteractor.PickOptionRequest.onPickOptionResult](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.PickOptionRequest.html#onPickOptionResult(kotlin.Boolean,%20kotlin.Array,%20android.os.Bundle))with false for finished. This finishes the request (it is no longer active).