List of usage examples for android.speech RecognizerIntent EXTRA_SUPPORTED_LANGUAGES
String EXTRA_SUPPORTED_LANGUAGES
To view the source code for android.speech RecognizerIntent EXTRA_SUPPORTED_LANGUAGES.
Click Source Link
From source file:com.ct.speech.HintReceiver.java
@Override public void onReceive(Context context, Intent intent) { if (getResultCode() != Activity.RESULT_OK) { return;/*from w w w . j a v a 2 s. co m*/ } // the list of supported languages. ArrayList<CharSequence> hints = getResultExtras(true) .getCharSequenceArrayList(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES); // Convert the map to json JSONArray languageArray = new JSONArray(hints); PluginResult result = new PluginResult(PluginResult.Status.OK, languageArray); result.setKeepCallback(false); // speechRecognizer.callbackId = ""; speechRecognizerPlugin.success(result, ""); }
From source file:com.corumgaz.mobilsayac.VoiceRecognizer.LanguageDetailsChecker.java
@Override public void onReceive(Context context, Intent intent) { Bundle results = getResultExtras(true); // get the list of supported languages if (results.containsKey(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES)) { // Convert the map to json supportedLanguages = results.getStringArrayList(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES); JSONArray jsonLanguages = new JSONArray(supportedLanguages); callbackContext.success(jsonLanguages); } else {/*from w w w . j av a 2 s.c o m*/ callbackContext.error("Could not retrieve the list of supported languages"); } }