admin管理员组文章数量:1131395
I have searched and found no answer why
AppCompatDelegate.getApplicationLocales()
returns []
(empty) It should have returned current language, which is nb-NO
. I guess this is the reason the next command is not working either:
AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags("locale"));
I do use AppCompat theme which is required from this post.
I do call this in the main activity in an onItemClicked()
. I have added all languages in build.gradle
android {
resourceConfiguration += ["da-rDK", "de-rDE" (rest of languages)]
}
I have added a locale_config.xml
file and added it in AndroidManifest.xml
<application
android:localeConfig="@xml/locale_config">
The strange thing is that I did a test app with just this functionality and it worked. But not when I add it into my other app.
本文标签: androidAppCompatDelegategetApplicationLocales() return Stack Overflow
版权声明:本文标题:android - AppCompatDelegate.getApplicationLocales() return [] - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736718166a1949317.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论