Skip to content

Commit

Permalink
Changed order, fixed EXTRA_MAX_RESULTS
Browse files Browse the repository at this point in the history
  • Loading branch information
koolspin committed Sep 20, 2011
1 parent 314cc64 commit ce16d3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Android/SpeechRecognizer/SpeechRecognizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void startSpeechRecognitionActivity(JSONArray args) {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
if (maxMatches > 0)
intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, Integer.toString(maxMatches));
intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, maxMatches);
if (!prompt.isEmpty())
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, prompt);
ctx.startActivityForResult(this, intent, reqCode);
Expand Down Expand Up @@ -169,14 +169,14 @@ private void ReturnSpeechResults(int requestCode, ArrayList<String> matches) {

PluginResult result = new PluginResult(PluginResult.Status.OK, sb.toString());
result.setKeepCallback(false);
this.speechRecognizerCallbackId = "";
this.success(result, this.speechRecognizerCallbackId);
this.speechRecognizerCallbackId = "";
}

private void ReturnSpeechFailure(int resultCode) {
PluginResult result = new PluginResult(PluginResult.Status.ERROR, Integer.toString(resultCode));
result.setKeepCallback(false);
this.speechRecognizerCallbackId = "";
this.error(result, this.speechRecognizerCallbackId);
this.speechRecognizerCallbackId = "";
}
}

0 comments on commit ce16d3f

Please sign in to comment.