Skip to content Skip to sidebar Skip to footer

Activity Has Leaked Serviceconnection Android.speech.speechrecognizer$connection

I'm trying to make a function in google glass that allows me to navigate between the cards without having to say the hotword 'ok glass'. I tried creating a SpeechRecognizer that wi

Solution 1:

It looks like the RecognitionService is already in use at the point that you call startListening(). I believe this is because you already called startListening() in your constructor and then call it again in onEndOfSpeech().

Make sure you make the necessary cancel() calls before calling startListening() again.

Solution 2:

You got RecognitionService busy because of this code

@OverridepublicvoidonEndOfSpeech() {
    mSpeechRecognizer.startListening(intent);
}

You should call mSpeechRecognizer.startListening(intent) in onResults

Post a Comment for "Activity Has Leaked Serviceconnection Android.speech.speechrecognizer$connection"