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

# SupportCallback

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/speech/RecognitionService.SupportCallback "View this page in Java")

```
open class SupportCallback
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.speech.RecognitionService.SupportCallback](https://developer.android.com/reference/kotlin/android/speech/RecognitionService.SupportCallback#) |

This class receives callbacks from the speech recognition service and forwards them to the user. An instance of this class is passed to the `https://developer.android.com/reference/kotlin/android/speech/RecognitionService#onCheckRecognitionSupport(android.content.Intent,%20android.speech.RecognitionService.SupportCallback)` method. Recognizers may call these methods on any thread.

## Summary

| Public methods ||
|---|---|
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/speech/RecognitionService.SupportCallback#onError(kotlin.Int)(errorCode: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` The service should call this method when an error occurred and can't satisfy the support request. |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/speech/RecognitionService.SupportCallback#onSupportResult(android.speech.RecognitionSupport)(recognitionSupport: https://developer.android.com/reference/kotlin/android/speech/RecognitionSupport)` The service should call this method to notify the caller about the level of support. |

## Public methods

### onError

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

```
open fun onError(errorCode: Int): Unit
```

The service should call this method when an error occurred and can't satisfy the support request.

| Parameters ||
|---|---|
| `errorCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): code is defined in `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer` Value is one of the following: - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_NETWORK_TIMEOUT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_NETWORK:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_AUDIO:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_SERVER:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_CLIENT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_SPEECH_TIMEOUT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_NO_MATCH:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_RECOGNIZER_BUSY:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_INSUFFICIENT_PERMISSIONS:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_TOO_MANY_REQUESTS:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_SERVER_DISCONNECTED:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_LANGUAGE_NOT_SUPPORTED:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_LANGUAGE_UNAVAILABLE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_CANNOT_CHECK_SUPPORT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/speech/SpeechRecognizer#ERROR_CANNOT_LISTEN_TO_DOWNLOAD_EVENTS:kotlin.Int` |

### onSupportResult

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

```
open fun onSupportResult(recognitionSupport: RecognitionSupport): Unit
```

The service should call this method to notify the caller about the level of support.

| Parameters ||
|---|---|
| `recognitionSupport` | [RecognitionSupport](https://developer.android.com/reference/kotlin/android/speech/RecognitionSupport): This value cannot be `null`. |