本文介绍了如何锁定任何Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我对Android应用开发的新手,我想使启动时,可以锁定任何应用程序。对于例如,如果有人打开浏览器或任何其他应用程序它只是锁定它。I am a newbie on android apps development, I want to make a application which can lock any application when started. For eg if someone opens chrome or any other application it simply locks it.推荐答案也许你不会得到任何直接的解决方案,that.you必须创建将在background.You运行服务,可以定期检查,以找到正在运行的进程。然后你可以找到包名称要kill.Finally使用ActivityManager的killBackgroundProcess杀process.This方法只杀死背景process.So如果要停止开始只运行浏览器发送背景(如果你把你的活动进程自动前景会回来),然后运行killBackgroundProcess(PKGNAME)。Maybe you will not get any straight forward solution for that.you have to create a service that will run on the background.You can check periodically to find therunning process.Then you can find the package name for the process which you want to kill.Finally use killBackgroundProcess of the ActivityManager to kill the process.This method only kill background process.So if you want to stop browser that starts running simply send that in background(If you bring your activity in foreground it automatically will be back) and run the killBackgroundProcess(pkgName). 这篇关于如何锁定任何Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-24 17:24