0
我一直在尝试使用下面的代码来改变区域:安卓:更改为不支持的语言环境
private void changeLocal(Locale locale){
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config,
getBaseContext().getResources().getDisplayMetrics());
refresh();
}
private void refresh() {
finish();
Intent myIntent = new Intent(this, getClass());
startActivity(myIntent);
}
它为法国而不是希伯来语。所以我通过调用Locale.getAvailableLocales()
来查看设备支持的语言环境,我发现法语在那里,但希伯来语不是。
如果我把硬编码的希伯来语文本,我可以看到它,所以它被安装,但我不知道如何强制设备使用它。
请帮助我强制使用希伯来语的设备。
PS 加入
android:configChanges="locale|layoutDirection"
到我的清单,即使它不叫我的活动
希伯来语的语言环境是'iw',而不是'he'' – levengli