2016-11-19 40 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;'可以用來讀取當前的語言環境。 –

相關問題