以下代码用于将应用程序区域设置更改为西班牙语在某些设备中正常工作,但在某些设备中,它正在放大(缩放)应用程序中的视图.有人有解决方案吗?
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();
Run Code Online (Sandbox Code Playgroud)