Using Android Voice Control launch my Activity

天涯浪子 提交于 2020-01-03 06:41:14

问题


I have read this post on SO and I have tried the code to launch my own speech recognition activity. It worked!. So my question is that how can I customize the action of the built in voice command button(hardware) to launch the activity which I have written instead of the built in voice search? I have thoroughly searched the net including this website. But I could not find a solution. I know that someone on SO has it!!!


回答1:


You must use SpeechRecognizer instead of RecognizerIntent. It's a little harder to use, but you get full control.

For code see my response from here:

and my discussion of the differences between the two approaches here



来源:https://stackoverflow.com/questions/10215571/using-android-voice-control-launch-my-activity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!