Android应用自杀和干掉其它进程

// 自杀(这种方式只能杀掉自己的进程,其它进程无法杀死)
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");

posted @ 2013-10-24 20:08  奋斗+坚持  阅读(899)  评论(0编辑  收藏  举报