In my app I recognize the user saying \"exit\" or \"close\" and the app should close. With this code
SpeechRecognizer sr; Map dictiona
The problem was the most trivial ever: I declared the SpeechRecognizer two times, one for the class and another inside the onCreate() method. The variable was initialized only in the function scope, so outside the function sr was always null.
SpeechRecognizer
onCreate()
sr