我正在尝试通过程序删除所有最近的任务.在发布问题之前,我先用谷歌搜索过,但根本没有运气.
I am trying to remove all recent tasks through a program. Before posting a question, I googled it, but no luck at all.
我尝试使用ActivityManager.killBackgroundProcess(pckagename),但是它也没有从最近的任务列表中删除该任务.
I tried to use ActivityManager.killBackgroundProcess(pckagename), but it also does not remove the task from a recent task list.
我也尝试了链接 Android,如何清除大多数手机中可以通过主页"按钮获得的近期任务列表?反思是一种可能的方式吗?
我总是遇到以下异常
java.lang.SecurityException:权限被拒绝: 从pid = 23297中移除removeTask(),uid = 10051需要 android.permission.REMOVE_TASKS
java.lang.SecurityException: Permission Denial: removeTask() from pid=23297, uid=10051 requires android.permission.REMOVE_TASKS
即使我已经在清单中指定了android.permission.REMOVE_TASKS权限.
Even if I already specified the android.permission.REMOVE_TASKS permission in the manifest.
我们如何以编程方式清除近期任务列表,以便用户在近期任务列表中看不到任何近期任务?
How can we clear the list of recent tasks programmatically, so that the user can see no recent tasks in a recent task list?
推荐答案REMOVE_TASKS是signature级权限.它只能由设备固件开发人员(例如设备制造商或ROM mod作者)编写的应用程序持有.
REMOVE_TASKS is a signature-level permission. It can only be held by apps written by the developers of the device firmware, such as a device manufacturer or ROM mod author.
更多推荐
以编程方式清除所有最近的任务
发布评论