我创建了多语言(英语,俄语,乌兹别克语)应用程序.我将4个字符串resoureses放在4个文件夹(values,values-en,values-ru,values-uz)中作为docs.当我在App Controller中更改应用程序语言更新资源时,如下所示:
Settings.LANGUAGE = prefs.getString(User.LANG, Settings.RUSSIAN);
Locale locale = new Locale(Settings.LANGUAGE);
Locale.setDefault(locale);
Configuration configuration = new Configuration();
configuration.locale = locale;
getBaseContext().getResources().updateConfiguration(configuration,
getBaseContext().getResources().getDisplayMetrics());
Run Code Online (Sandbox Code Playgroud)
之后通过调用App控制器的方法重新启动应用程序,如下所示:
public void reStart() {
Intent i = getBaseContext().getPackageManager()
.getLaunchIntentForPackage(getBaseContext().getPackageName());
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
}
Run Code Online (Sandbox Code Playgroud)
在他们之后它几乎适用于所有设计.但在三星Galaxy S6(SM-G920F)上,它的工作原理很疯狂.有些词是英语,有些是乌兹别克语和ets.那么,如何修复此错误?是不是(适用于)所有设备支持的"支持不同语言"的概念?顺便说一句,我已经检查过所有资源都是用相应的语言给出的(如附图所示):
DayNight 主题有四种情况:
第一种和第二种情况是正常的。不幸的是,第三和第四种情况并不如预期。BiometricPrompt 对话框获取设备的 ui 模式。我想为 BiometricPrompt 对话框应用应用程序 UI 模式。您可以在下面看到问题: