如何以编程方式检查手机是否具有特定区域设置?
最佳答案
您可以使用 getAvailableLocales()
获取一组 Locale
,然后遍历它以查看它是否可用。
boolean hasLocale = false;
String myLocale = "en";
Locale[] locales = Locale.getAvailableLocales();
for (Locale locale : locales) {
if (locale.getLanguage().equals(myLocale)) {
hasLocale = true;
}
}
// Value of `hasLocale` is what you want here!
关于android - 检查 Android 手机是否具有特定语言环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12119642/