以编程方式清除所有最近的任务

编程入门 行业动态 更新时间:2024-10-24 22:23:33
本文介绍了以编程方式清除所有最近的任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试通过程序删除所有最近的任务.在发布问题之前,我先用谷歌搜索过,但根本没有运气.

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.

更多推荐

以编程方式清除所有最近的任务

本文发布于:2023-11-24 08:52:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624543.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方式

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!