3

I'm aware of java.util.Locale and Locale.getAvailableLocales() and I'm also aware of the Settings.ACTION_LOCALE_SETTINGS intent. Neither of these accomplish what I need. Locale.getAvailableLocales() returns all languages supported by the Android device and I need the list of locales for something special (not related to switching) so the intent doesn't help. The list that is shown for that intent is what I need though.

I've looked through the Android source for the Settings app and found the relevant code, but in using the code in the LocalePicker's onCreate method, I am still seeing all locales supported. Is there anyway to get that list? Am I missing something in just ripping that code from the LocalePicker?

J.R. Garcia
  • 639
  • 5
  • 20

1 Answers1

0

If you call

Locale[] locales = Locale.getAvailableLocales();

You'll get an array of Locales, then use

locale.toString();

to get the locale name.

Leo Moura
  • 61
  • 1
  • 4
  • 4
    The problem I'm having is that that doesn't return the list of *installed* locales; it returns a list of all *supported* locales. – J.R. Garcia Apr 20 '12 at 04:17