有什么办法杀死与已知的包名的应用程序?有什么办法、应用程序

2023-09-07 12:05:28 作者:淡淡的忧伤

我使用以下code:

for(int i = 0; i < numOfTasks; i++)
ActivityManager.RunningAppProcessInfo task = tasksP.get(i);

task.processName 我收到工艺包名称,例如 com.android.alarmclock (运行应用程序)

from task.processName I am getting process package name e.g com.android.alarmclock (running app)

我要杀死这个应用程序,反正是有做到这一点?

I want to kill this application, is there anyway to do that ??

推荐答案

有是杀一个应用双向

/* Way one */
android.os.Process.killProcess(android.os.Process.myPid())

/* Way Two */
System.exit(0);