閱讀492 返回首頁    go 阿裏雲 go 技術社區[雲棲]


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

  上一篇:go mysql hash 索引 vs B-TREE 索引 理解
  下一篇:go Java IO--RandomAccessFile類