Code example for SpeechRecognizer

Methods: stopListening

0
        Handler loopHandler = new Handler(Looper.getMainLooper());
        loopHandler.post(new Runnable() {
 
            @Override 
            public void run() { 
                recognizer.stopListening();
            } 
             
        }); 
    } 
 
    /** 
     * Initialize the speech recognizer by checking if one exists. 
     */ 
    private boolean DoInit() { 
        this.recognizerPresent = SpeechRecognizer.isRecognitionAvailable(this.cordova.getActivity().getBaseContext());
        return this.recognizerPresent;
    } 
 
    private void fireRecognitionEvent(ArrayList<String> transcripts, float[] confidences) {
        JSONObject event = new JSONObject();