Resources resources = context.getResources();
Configuration conf = resources.getConfiguration();
Locale locale = new Locale(language, country);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
conf.setLocale(locale);
} else {
conf.locale = locale;
}
resources.updateConfiguration(conf, resources.getDisplayMetrics());
1.需要在设置后重新启动Activity即可生效
2.不同的context更新会不一样(例如Application的context,和activity的context) 获取的resource不一样
所以在更新字体的时候尽量用用activity的context,vivoZ1 和华为mate9测试.