开发者

Is there any way to kill application with known package name?

I am using following code:

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

from task.processName I am getting process package nam开发者_如何学Goe e.g com.android.alarmclock (running app)

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


There is two way of killing an application

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

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜