如何杀死其他用户的后台进程? [英] How to kill another user's background process?

查看:811
本文介绍了如何杀死其他用户的后台进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能杀了使用其他用户的后台进程的 ActivityManager.kil​​lBackgroundProcesses

I'm not able to kill another user's background process using ActivityManager.killBackgroundProcesses.

code是:

 ActivityManager am = (ActivityManager)getSystemService(ACTIVITY_SERVICE);

 for (RunningAppProcessInfo pid : am.getRunningAppProcesses())
 {
     if (pid.processName.equals("com.example.sample"))
        am.killBackgroundProcesses("com.example.sample");
 }

其中, com.example.sample 是后台进程的包,我想删除。

Where com.example.sample is the package of the background process which I want to delete.

这进程仍然在后台运行,这样就完成了。

That process is still running in the background after this completes.

推荐答案

您只能杀死自己的应用程序,例如在相同的工艺或用相同的用户ID运行的那些。你不能杀别人,除非该设备是植根。

You can only kill your own apps, e.g. the ones running in the same process or with the same userID. You can not kill others, unless the device is rooted.

看一看虽然回答,关于应用程序的杀戮后台进程。

Have a look at this answer though, about 'killing' background processes of apps.

这篇关于如何杀死其他用户的后台进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆