为什么玻璃/ GDK基础VoiceListener只有在XE16赶上VoiceCommand一次?玻璃、基础、GDK、VoiceCommand

2023-09-06 04:22:22 作者:转首泪倾城

在寻找一种方式来实现与谷歌的GDK我碰到这个 发表情境语音指令 。然而,例如code,似乎只有在XE12在XE16 +工作没有。我最近测试了这code,但 onVoiceCommand(...)只调用了曾在相关活动的寿命。我的期望将是用户的语音命令可以得到多次,即,如果用户返回到一定的活动从另一个。

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.

我甚至试图删除并重新安装活动和/或监听器内置VoiceInputHelper的GDKS活动时通过的onPause(...)和中背景 onResume(...)方法,但没有成功。任何有帮助的想法,为什么VoiceCommands是水涨船高一事后,以及他们如何能够重新启用?

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.

推荐答案

在stackoverflow.com/questions/21168267需要一个小的改变原有例如:上班continously 需要在 onVoiceCommand要返回()

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

 
精彩推荐
图片推荐