I am writing a JAR library that will be used on desktop and also on android. The JAR is localized, therefore I would like to know the current android language in order to set the locale accordingly.
How should I do that?
UPDATE: The locale is the same of the android language, but ResourceBundle.getString() always revert to the default locale.
LAST UPDATE: It's a bug on Android, if my locale is it_IT it looks exclusively for Locale_it_IT; and skips Locale_it (which instead is accepted on Java).
OOPS! it ACTUALLY was a bug on my code... android is case sensitive and I created a resourcebundle with locale IT instead of it开发者_运维知识库... shame on me.
Android supporrs the normal java Locale related methods, so you should be fine by just asking for Locale.getDefault()
精彩评论