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");
最後更新:2017-04-03 14:53:53