# VoiceInteractionSession.AssistState

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

# AssistState

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AssistState "View this page in Java")  

```
class AssistState
```

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

Represents assist state captured when this session was started. It contains the various assist data objects and a reference to the source activity.

## Summary

|                                                                                                                                                Public methods                                                                                                                                                 ||
|-----------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [VoiceInteractionSession.ActivityId](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.ActivityId) | [getActivityId](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.AssistState#getActivityId())`()` <br />           |
| [AssistContent](https://developer.android.com/reference/kotlin/android/app/assist/AssistContent.html#)?                                       | [getAssistContent](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.AssistState#getAssistContent())`()` <br />     |
| [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)?                                                             | [getAssistData](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.AssistState#getAssistData())`()` <br />           |
| [AssistStructure](https://developer.android.com/reference/kotlin/android/app/assist/AssistStructure.html#)?                                   | [getAssistStructure](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.AssistState#getAssistStructure())`()` <br /> |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                    | [getCount](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.AssistState#getCount())`()` <br />                     |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                    | [getIndex](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.AssistState#getIndex())`()` <br />                     |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                            | [isFocused](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.AssistState#isFocused())`()` <br />                   |

## Public methods

### getActivityId

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

```
fun getActivityId(): VoiceInteractionSession.ActivityId
```

|                                                                                                  Return                                                                                                  ||
|-----------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|
| [VoiceInteractionSession.ActivityId](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.ActivityId) | the id of the source activity This value cannot be`null`. |

### getAssistContent

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

```
fun getAssistContent(): AssistContent?
```

|                                                                                                                                                                                                                                                                                                                                                           Return                                                                                                                                                                                                                                                                                                                                                           ||
|---------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AssistContent](https://developer.android.com/reference/kotlin/android/app/assist/AssistContent.html#)? | Additional content data supplied by the app through[Activity.onProvideAssistContent](https://developer.android.com/reference/kotlin/android/app/Activity.html#onProvideAssistContent(android.app.assist.AssistContent)). May be null if assist data has been disabled by the user or device policy; will be null if the original show request did not specify[SHOW_WITH_ASSIST](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession#SHOW_WITH_ASSIST:kotlin.Int). Will not be automatically filled in with data from the app if the app has marked its window as secure. |

### getAssistData

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

```
fun getAssistData(): Bundle?
```

|                                                                                                                                                                                                                                                                             Return                                                                                                                                                                                                                                                                              ||
|-----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)? | Arbitrary data supplied by the app through[Activity.onProvideAssistData](https://developer.android.com/reference/kotlin/android/app/Activity.html#onProvideAssistData(android.os.Bundle)). May be null if assist data has been disabled by the user or device policy; will be null if the original show request did not specify[SHOW_WITH_ASSIST](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession#SHOW_WITH_ASSIST:kotlin.Int). |

### getAssistStructure

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

```
fun getAssistStructure(): AssistStructure?
```

|                                                                                                                                                                                                                                                                                                                                                                          Return                                                                                                                                                                                                                                                                                                                                                                          ||
|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AssistStructure](https://developer.android.com/reference/kotlin/android/app/assist/AssistStructure.html#)? | If available, the structure definition of all windows currently displayed by the app. May be null if assist data has been disabled by the user or device policy; will be null if the original show request did not specify[SHOW_WITH_ASSIST](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession#SHOW_WITH_ASSIST:kotlin.Int)or the assist data has been corrupt when writing the data to[AssistStructure](https://developer.android.com/reference/kotlin/android/app/assist/AssistStructure.html#); will be an empty stub if the application has disabled assist by marking its window as secure. |

### getCount

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

```
fun getCount(): Int
```

|                                                                                    Return                                                                                     ||
|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the total number of activities for which the assist data is being returned. Value is 0 or greater |

### getIndex

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

```
fun getIndex(): Int
```

|                                                                                             Return                                                                                              ||
|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the index of the activity that this state is for or -1 if there was no assist data captured. Value is -1 or greater |

### isFocused

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

```
fun isFocused(): Boolean
```

|                                                           Return                                                            ||
|------------------------------------------------------------------------------------|-----------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | whether the source activity is focused. |