小编Amr*_*ngh的帖子

如何设置西班牙语拉丁美洲的区域设置?

如何设置西班牙语拉丁美洲的区域设置?
我已将所有字符串存储在西班牙拉丁美洲的 value-b+es+r419 文件夹中。但无法在区域设置中设置此语言。应用程序仅显示默认语言,而不是更改应用程序的语言。

Locale locale = new Locale("es","419"); 
Locale.setDefault(locale); 
Configuration config = new Configuration(); 
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {         
    config.setLocale(locale); 
} else{ 
    config.locale=locale; 
} 
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { 
    context.createConfigurationContext(config); 
} else { 
    context.getResources()
           .updateConfiguration(config, context.getResources().getDisplayMetrics()); 
}
Run Code Online (Sandbox Code Playgroud)

string android locale

5
推荐指数
0
解决办法
2319
查看次数

标签 统计

android ×1

locale ×1

string ×1