Why does Glass/GDK based VoiceListener only catch VoiceCommand once in XE16?

南楼画角 提交于 2019-12-06 01:10:16

问题


In search for a way to implement contextual voice commands with Google's GDK i came across this post. Yet, the example code seems to work only in XE12 not in XE16+. I tested this code recently, but the onVoiceCommand(...) method is only called once in the lifetime of a related Activity. My expectation would be that a user's voice command can be obtained multiple times, i.e., if a user returns to a certain Activity from another one.

I even tried to remove and reattach the Activity and/or Listener to the GDKs built-in VoiceInputHelper when the Activity is backgrounded via the onPause(...) and onResume(...) method, yet no success. Any helpful ideas why VoiceCommands are "gone" after one event and how they can be "reenabled"?

I can test your ideas/solutions as I have a Glass device at hand, and I verify any input rapidly.


回答1:


The original example in at stackoverflow.com/questions/21168267 needs a small change: to work continously null needs to be returned in onVoiceCommand().



来源:https://stackoverflow.com/questions/23441199/why-does-glass-gdk-based-voicelistener-only-catch-voicecommand-once-in-xe16

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