// 自杀(这种方式只能杀掉自己的进程,其它进程无法杀死)
int pid = Process.myPid();
android.os.Process.killProcess(pid);
// 或者 Process.sendSignal(pid, Process.SIGNAL_KILL);
// 杀死其它进程(这程方式不能杀自己的进程)
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
am.killBackgroundProcesses("com.xxx.xxx");
转载于:https://www.cnblogs.com/xyang0917/p/4172507.html