Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/app/VoiceInteractor.Request#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/VoiceInteractor.Request#inhmethods)

# VoiceInteractor.Request

*** ** * ** ***

` public static abstract class VoiceInteractor.Request `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.VoiceInteractor.Request |

Known direct subclasses [VoiceInteractor.AbortVoiceRequest](https://developer.android.com/reference/android/app/VoiceInteractor.AbortVoiceRequest), [VoiceInteractor.CommandRequest](https://developer.android.com/reference/android/app/VoiceInteractor.CommandRequest), [VoiceInteractor.CompleteVoiceRequest](https://developer.android.com/reference/android/app/VoiceInteractor.CompleteVoiceRequest), [VoiceInteractor.ConfirmationRequest](https://developer.android.com/reference/android/app/VoiceInteractor.ConfirmationRequest), [VoiceInteractor.PickOptionRequest](https://developer.android.com/reference/android/app/VoiceInteractor.PickOptionRequest) [VoiceInteractor.AbortVoiceRequest](https://developer.android.com/reference/android/app/VoiceInteractor.AbortVoiceRequest) Reports that the current interaction can not be complete with voice, so the application will need to switch to a traditional input UI. [VoiceInteractor.CommandRequest](https://developer.android.com/reference/android/app/VoiceInteractor.CommandRequest) Execute a vendor-specific command using the trusted system VoiceInteractionService. [VoiceInteractor.CompleteVoiceRequest](https://developer.android.com/reference/android/app/VoiceInteractor.CompleteVoiceRequest) Reports that the current interaction was successfully completed with voice, so the application can report the final status to the user. [VoiceInteractor.ConfirmationRequest](https://developer.android.com/reference/android/app/VoiceInteractor.ConfirmationRequest) Confirms an operation with the user via the trusted system VoiceInteractionService. [VoiceInteractor.PickOptionRequest](https://developer.android.com/reference/android/app/VoiceInteractor.PickOptionRequest) Select a single option from multiple potential options with the user via the trusted system VoiceInteractionService.   

*** ** * ** ***

Base class for voice interaction requests that can be submitted to the interactor. Do not instantiate this directly -- instead, use the appropriate subclass.

## Summary

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/app/VoiceInteractor.Request#cancel()() ` Cancel this active request. |
| ` https://developer.android.com/reference/android/app/Activity` | ` https://developer.android.com/reference/android/app/VoiceInteractor.Request#getActivity()() ` Return the current `https://developer.android.com/reference/android/app/Activity` this request is associated with. |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/app/VoiceInteractor.Request#getContext()() ` Return the current `https://developer.android.com/reference/android/content/Context` this request is associated with. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/app/VoiceInteractor.Request#getName()() ` Return the name this request was submitted through `https://developer.android.com/reference/android/app/VoiceInteractor#submitRequest(android.app.VoiceInteractor.Request,%20java.lang.String)`. |
| ` void` | ` https://developer.android.com/reference/android/app/VoiceInteractor.Request#onAttached(android.app.Activity)(https://developer.android.com/reference/android/app/Activity activity) ` The request is now attached to an activity, or being re-attached to a new activity after a configuration change. |
| ` void` | ` https://developer.android.com/reference/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/android/app/VoiceInteractor.Request#cancel()` or when the user explicitly cancelled. |
| ` void` | ` https://developer.android.com/reference/android/app/VoiceInteractor.Request#onDetached()() ` The request is being detached from an activity. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/app/VoiceInteractor.Request#toString()() ` Returns a string representation of the object. |

### 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*.

## Public methods

### cancel

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

```
public void cancel ()
```

Cancel this active request.

<br />

### getActivity

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

```
public Activity getActivity ()
```

Return the current `https://developer.android.com/reference/android/app/Activity` this request is associated with. Will change if the activity is restarted such as through a configuration change.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Activity` | <br /> |

### getContext

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

```
public Context getContext ()
```

Return the current `https://developer.android.com/reference/android/content/Context` this request is associated with. May change if the activity hosting it goes through a configuration change.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | <br /> |

### getName

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

```
public String getName ()
```

Return the name this request was submitted through `https://developer.android.com/reference/android/app/VoiceInteractor#submitRequest(android.app.VoiceInteractor.Request,%20java.lang.String)`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### onAttached

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

```
public void onAttached (Activity activity)
```

The request is now attached to an activity, or being re-attached to a new activity after a configuration change.

<br />

| Parameters ||
|---|---|
| `activity` | `Activity` <br /> |

### onCancel

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

```
public void 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/android/app/VoiceInteractor.Request#cancel()` or when the user explicitly cancelled.

<br />

### onDetached

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

```
public void onDetached ()
```

The request is being detached from an activity.

<br />

### toString

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

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |