Code example for SpeechRecognizer

Methods: startListening

0
            Handler loopHandler = new Handler(Looper.getMainLooper()); 
            loopHandler.post(new Runnable() { 
 
                @Override 
                public void run() { 
                    recognizer.startListening(intent);
                } 
                 
            }); 
             
            PluginResult res = new PluginResult(PluginResult.Status.NO_RESULT);
            res.setKeepCallback(true); 
            callbackContext.sendPluginResult(res); 
        } 
        else if (ACTION_SPEECH_RECOGNIZE_STOP.equals(action)) { 
            stop(false); 
        } 
        else if (ACTION_SPEECH_RECOGNIZE_ABORT.equals(action)) { 
            stop(true); 
        } 
        else {