Detect current running application in Android Nougat 7.+ version

爷,独闯天下 提交于 2019-12-23 08:54:02

问题


Android team changed their approaches to get current running applications from time to time. I am able to get current running applications upto Marshmallow 6.0 version but i want to ask that how can i get these in Nougat 7.0 version? Is there anyway to do that? Please guide towards solutions. I have searched a lot but could find any appropriate way to that.

Thanks


回答1:


Simple answer: no, you can't.

Long answer: you can't get the running process but you can retrospectively see what was running through the UsageStatsManager (with the appropriate permissions, of course). The reason you can't get the running process is that Android have locked down the permissions of /proc



来源:https://stackoverflow.com/questions/41768642/detect-current-running-application-in-android-nougat-7-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!