How to check from scheduled agent if the foreground app is running

て烟熏妆下的殇ゞ 提交于 2019-12-11 09:58:21

问题


Is it possible to check if the foreground app is running from a scheduled task? In my case, it duplicates a functionality of the app - so I could skip that part in the agent to preserve resources.

Thanks


回答1:


You cannot access a list of processes or anything similiar that would give you the info if your app is running.

You can do smething like storing a flag to the settings when your app starts and erasing it when your app exists and check this flag in the background agent.



来源:https://stackoverflow.com/questions/18342640/how-to-check-from-scheduled-agent-if-the-foreground-app-is-running

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