I wrote a speech recognition app using android's built-in speech recognition classes. The following exception shows up in my developer console when the startListening function is called on the speech recognizer object obtained using createSpeechRecognizer(context) function.
SecurityException:
java.lang.SecurityException: Not allowed to bind to service Intent
{ act=android.speech.RecognitionService
cmp=com.htc.android.voicedictation/.VoiceDictationService
}
Any ideas why this is happening and how to fix this?
Tested working on Nexus 7 & HTC ONE X.
Failed on HTC ONE M7 (4.2.2)
Found the root cause of this issue from this link: https://groups.google.com/forum/#!topic/joaomgcd/qcSfL2-SIfk
Solution: Google voice typing must be enabled on a device.
Steps to enable Google voice typing on HTC One device: http://eguides.sprint.com/support/eguides/htconem8/index.html#htc_one_m8_ug/keyboard_and_input_methods_google_voice_typing.html
I have faced the same issue. I solved it by Going to Settings-> Language & keyboard -> Voice Input-> Then enable the 'Basic Google recognition', as this radio button was disabled in my same HTC phone.
来源:https://stackoverflow.com/questions/25250761/speech-recognizer-on-htc-one-m7