Android Kill Process

知识的领域是无限的,我们的学习也是无限期的。这篇文章主要讲述Android Kill Process相关的知识,希望能为你提供帮助。

/********************************************************************** *android Kill Process * 说明: *在Android App中杀死其他的App进程。 * *2017-8-5 深圳 龙华樟坑村 曾剑锋 *********************************************************************/一、参考文档: 1. Why KILL_BACKGROUND_PROCESSES doesn‘t work? [closed] https://stackoverflow.com/questions/15030863/why-kill-background-processes-doesnt-work二、处理代码: ... ActivityManager manager = (ActivityManager)getSystemService(ACTIVITY_SERVICE); try { manager.killBackgroundProcesses("com.example.xxx"); } catch (Exception ex) { Log.e(TAG, ex.toString()); } ...三、错误现象: W/ActivityManager(506): Permission Denial: killBackgroundProcesses() from pid=11476, uid=10043 requires android.permission.KILL_BACKGROUND_PROCESSES E/AplexOS (11476): java.lang.SecurityException: Permission Denial: killBackgroundProcesses() from pid=11476, uid=10043 requires android.permission.KILL_BACKGROUND_PROCESSES四、解决办法: 添加权限:< user-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />

【Android Kill Process】 

    推荐阅读