2016-11-19 43 views

回答

0

您可以通过在运行时更新资源配置来更改应用程序语言。像这样的代码:

Resources res=getResources(); 
    Configuration config = res.getConfiguration(); 
    Locale locale = new Locale("fr");//change to the France language 
    Locale.setDefault(locale); 
    config.locale = locale; 
    res.updateConfiguration(config, res.getDisplayMetrics()); 
+0

谢谢。你的代码显然是 – aRaKaNoiD

+0

这不是问题。但是'Locale current = getResources()。getConfiguration()。locale;'可以用来读取当前的语言环境。 –

相关问题