1

I am following this and query for the list of supported languages by sending a RecognizerIntent.ACTION_GET_LANGUAGE_DETAILS ordered broadcast like so:

Intent detailsIntent =  new Intent(RecognizerIntent.ACTION_GET_LANGUAGE_DETAILS);
sendOrderedBroadcast(
        detailsIntent, null, new LanguageDetailsChecker(), null, Activity.RESULT_OK, null, null);

where LanguageDetailsChecker is something like this:

public class LanguageDetailsChecker extends BroadcastReceiver
{
    private List<String> supportedLanguages;

    private String languagePreference;

    @Override
    public void onReceive(Context context, Intent intent)
    {
        Bundle results = getResultExtras(true);
        if (results.containsKey(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE))
        {
            languagePreference =
                    results.getString(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE);
        }
        if (results.containsKey(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES))
        {
            supportedLanguages =
                    results.getStringArrayList(
                            RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES);
        }
    }
}

Now I want to know whether supportedLanguages are fixed for a device in whole life and is it good to fetch first time and cache it permanently? Does it depend on any device settings customization?

Brij
  • 6,086
  • 9
  • 41
  • 69

0 Answers0