导包:
import java.util.Locale;
import android.app.Activity;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.DisplayMetrics;
代码:
Resources res = getResources();
/* 更改语系为JAPAN */Configuration conf = res.getConfiguration();
conf.locale = Locale.JAPAN;
DisplayMetrics dm = res.getDisplayMetrics();
/* 保存语系变更 */
res.updateConfiguration(conf, dm);
//检查版本
if (getApplicationInfo().targetSdkVersion <= Build.VERSION_CODES.GINGERBREAD)
//退出当前进程
android.os.Process.killProcess(android.os.Process.myPid());