Pergunta

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.

Foi útil?

Solução

the Intent AKA "System Event" for this would be the RecognizerIntent and here is where you would dig for that

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

Now based on what your asking for, You want your App to have a voice rec search that returns the result to the app and processes those results? If that be the case then you could inherit from the RecognitionListener and your onResult "Event handler" you would do what you want. btw the documentation for that is here.

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

if neither of those are what you want then please clarify what it is that you are looking for.

Oh and just for good measure here is a blog post from the android team about using the speech api along with a sample.

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

So hopefully that covers most of the bases.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top