Added in API level 33

RecognitionService.SupportCallback


public static class RecognitionService.SupportCallback
extends Object

java.lang.Object
   ↳ 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 RecognitionService#onCheckRecognitionSupport(Intent, SupportCallback) method. Recognizers may call these methods on any thread.

Summary

Public methods

void onError(int errorCode)

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

void onSupportResult(RecognitionSupport recognitionSupport)

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

Inherited methods

Public methods

onError

Added in API level 33
public void onError (int errorCode)

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

Parameters
errorCode int: code is defined in SpeechRecognizer Value is SpeechRecognizer.ERROR_NETWORK_TIMEOUT, SpeechRecognizer.ERROR_NETWORK, SpeechRecognizer.ERROR_AUDIO, SpeechRecognizer.ERROR_SERVER, SpeechRecognizer.ERROR_CLIENT, SpeechRecognizer.ERROR_SPEECH_TIMEOUT, SpeechRecognizer.ERROR_NO_MATCH, SpeechRecognizer.ERROR_RECOGNIZER_BUSY, SpeechRecognizer.ERROR_INSUFFICIENT_PERMISSIONS, SpeechRecognizer.ERROR_TOO_MANY_REQUESTS, SpeechRecognizer.ERROR_SERVER_DISCONNECTED, SpeechRecognizer.ERROR_LANGUAGE_NOT_SUPPORTED, SpeechRecognizer.ERROR_LANGUAGE_UNAVAILABLE, SpeechRecognizer.ERROR_CANNOT_CHECK_SUPPORT, or SpeechRecognizer.ERROR_CANNOT_LISTEN_TO_DOWNLOAD_EVENTS

onSupportResult

Added in API level 33
public void onSupportResult (RecognitionSupport recognitionSupport)

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

Parameters
recognitionSupport RecognitionSupport: This value cannot be null.