2

In my application I have a "search" screen where the user types into an EditText and then clicks a button to do a search.

I'd like the screen to automatically trigger the search after the user has used the voice recognition utility to populate the EditText with text. Is there a handler I can listen for to do this? I'm looking for a handler or message specifically for a voice recognition return.

4

1 回答 1

3

用于此的 Intent 又名“系统事件”将是 RecognizerIntent ,这是您可以挖掘的地方

http://developer.android.com/reference/android/speech/RecognizerIntent.html

现在根据您的要求,您希望您的应用程序有一个语音记录搜索,将结果返回到应用程序并处理这些结果?如果是这种情况,那么您可以从 RecognitionListener 和您的 onResult “事件处理程序”继承,您会做您想做的事。顺便说一句,文档在这里。

http://developer.android.com/reference/android/speech/RecognitionListener.html

如果这些都不是您想要的,那么请澄清您正在寻找的是什么。

哦,为了更好的衡量,这里是 android 团队关于使用语音 api 和示例的博客文章。

http://android-developers.blogspot.com/2010/03/speech-input-api-for-android.html

所以希望这涵盖了大部分基础。

于 2010-12-13T19:44:41.850 回答