Background execution in Oreo Android devices

╄→尐↘猪︶ㄣ 提交于 2019-12-25 01:19:22

问题


Mine is a Cordova based hybrid app. Inside our activity(say A), there is a button which when clicked launches another activity, say B. B is actually inside a cordova plugin. So of course we use javascript to initiate B.

So when B is running, A wants to know the last active timestamp. A triggers a javascript call(since B is inside a plugin) to get the last active stamp every 1 minute.

In devices below Oreo, everything works fine. In devices with Oreo, the javascript call gets blocked after 5 minutes of B getting in foreground. No further javascript calls get executed.

If I kill B and return to A, this call gets executed.

I know this happens because of new background execution limits in Oreo.

How can I make sure that javascript calls are executed from A when B is foreground in Oreo devices? What are the options I have?

来源:https://stackoverflow.com/questions/55136177/background-execution-in-oreo-android-devices

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