无论手机中设置了什么,我都试图覆盖语言环境以使用捷克语言环境。但是,虽然当我尝试获取当前语言环境时,它返回捷克语,但对于复数,它的行为就像它仍然需要真正的电话语言环境。
这是我的代码:
<application
android:name=".xxx"
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/Theme.mystyle"
android:configChanges="locale"
>
在应用中:
String lang = settings.getString("cs", "");
locale = new Locale(lang);
Locale.setDefault(locale);
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());