Code example for SpeechRecognizer

Methods: cancel, stopListening

0
	//Run from the main thread :) 
	public void stopSpeechRecognition(){ 
		context.runOnUiThread(new Runnable() {
			public void run() { 
				if(recogniser != null){
					recogniser.cancel();
					recogniser.stopListening();
				} 
			} 
		}); 
 
	} 
 
	public void startSpeechIntent() 
	{ 
		Log.i(TAG, "Initialise speech");
 
		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,