//应用内设置语言
Resources resources = getResources();
Configuration config = resources.getConfiguration();
DisplayMetrics am = resources.getDisplayMetrics();
config.locale = Locale.SIMPLIFIED_CHINESE;
resources.updateConfiguration(config, am);
//刷新页面,使语言设置即时刷新
Intent intent = new Intent(MainActivity.this, MainActivity.class);
//将切换动画设置为无.让用户产生语言即时刷新的错觉
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
Resources resources = getResources();
Configuration config = resources.getConfiguration();
DisplayMetrics am = resources.getDisplayMetrics();
config.locale = Locale.SIMPLIFIED_CHINESE;
resources.updateConfiguration(config, am);
//刷新页面,使语言设置即时刷新
Intent intent = new Intent(MainActivity.this, MainActivity.class);
//将切换动画设置为无.让用户产生语言即时刷新的错觉
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent);
//退出当前activity,返回系统桌面
Intent home = new Intent(Intent.ACTION_MAIN);
home.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
home.addCategory(Intent.CATEGORY_HOME);
startActivity(home);