Merge pull request #152 from koolspin/master

Clear callback id on error
This commit is contained in:
macdonst
2011-09-20 07:29:07 -07:00

View File

@@ -124,7 +124,7 @@ public class SpeechRecognizer extends Plugin {
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);
@@ -177,5 +177,6 @@ public class SpeechRecognizer extends Plugin {
PluginResult result = new PluginResult(PluginResult.Status.ERROR, Integer.toString(resultCode));
result.setKeepCallback(false);
this.error(result, this.speechRecognizerCallbackId);
this.speechRecognizerCallbackId = "";
}
}