I am working on a ListnerRecognizer Listner.
I start the intent (startListning (intent)) from the webview button click click javascript
act.startFun();
And the startFun () method is declared in MainActivity.java
public void startFun(){ Log.d(TAG,"ONCLICK"); Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,"voice.recognition.test"); intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS,5); sr.startListening(intent); }
and my SpeechRecognizer Listner is similar to
class listner implements RecognitionListener{ public void onResults(Bundle results) { end=1; Log.d(TAG, "onResults"); } public void onRmsChanged(float rmsdB) { Log.d(TAG, "onRmsChanged"); } }
My requirement is that I want to pass the result resultResults (Bundle results) to my javascript method.
Please help me achieve this.
source share