code: public static String getSpeechRecognitionResultFromDicionary(int requestCode, int resultCode, Intent data, ArrayList<String> array) {
  		ArrayList<String> matches = null;
  		if (requestCode == 0 && resultCode == -1) {
  			matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
  			StringBuilder sb = new StringBuilder();
  			for (String match : matches) {
  				for (String arrayString : array) {
  					if (arrayString.equals(match)) {
  						return match;
  					}
  				}
  
  			}
  		}
  		return null;
  	}
docs: Get the first result that matches the Result List from Google Speech
  Recognition activity (DO NOT FORGET call this function on onActivityResult()) and the Dictionary
  given
  
  @param requestCode
  - onActivityResult request code
  @param resultCode
  - onActivityResult result code
  @param data
  - onActivityResult Intent data
  @param array
  - Dictionary with all keywords
  
  @return String with the first result matched or null if was not possible
  to get any result