1

我想创建一个应用程序,并且在我的应用程序中支持多种语言。但是当我更改语言时,我无法更改键盘语言。这是在我的应用程序中更改语言的代码...

String [] lCode = getResources().getStringArray(R.array.language_code);
Locale locale = new Locale(lCode[position]);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());

这里的language_code值xml ...

en-us zh_TW fr de ru es

4

0 回答 0