以下代码是用于将应用程序语言环境更改为西班牙语的,它在某些设备上正常工作,但在某些设备上会放大(缩放)应用程序视图。是否有人有解决方案?
Configuration config = getResources().getConfiguration();
// change this to a different Locale than your device
Locale locale = new Locale("es", "es_ES");
config.locale = locale;
Locale.setDefault(locale);
getBaseContext().getResources().updateConfiguration(config, getResources().getDisplayMetrics());
Log.i("onSelected..", Locale.getDefault().getCountry());
startActivity(new Intent(getApplicationContext(), HomePage.class));
finish();