mirror of
https://github.com/purplecabbage/phonegap-plugins.git
synced 2026-04-24 03:00:11 -04:00
Merge pull request #152 from koolspin/master
Clear callback id on error
This commit is contained in:
@@ -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 = "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user