Code example for SpeechRecognizer

Methods: cancel

0
   public void destroy() { 
      mSpeechRecognizer.destroy();
   } 
 
   public void cancel() { 
      mSpeechRecognizer.cancel();
   } 
 
   public void addCommand(String phrase, Command command) {
      mCommands.put(phrase, command);
   } 
 
   private Command getMatch(String phrase) {
      for (String command : mCommands.keySet()) {
         if (phrase.indexOf(command) != -1) {
            return mCommands.get(command);
         } 
      } 
 
      return null; 
   }