Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 8.x - setTimeOut / setInterval only works when the device plugged. #410

Open
Brainiac-88 opened this issue Nov 7, 2018 · 2 comments

Comments

@Brainiac-88
Copy link

Hi,
As you can see in the title on Android 8.x I have some problems. The functions above in the background only works when the device is plugged and my timer counters works fine. When the device is not charging it doesn't work expect when I unlock the screen. Any Idea / Solution / Setting ?
Thanks.

@wspresto
Copy link

wspresto commented Dec 5, 2018

There are two threads of JavaScript execution. WebView and WebCore. WebView is where settimeouts or setinervals are "queued", whereas webcore is where JS code relating to the plugins run. It is the WebCore thread which stays alive, while the WebView thread is "dozed". Therefore, you cannot assume setTimeouts or setIntervals or even XHR's will execute while in the background. Remember that these constructs are "deferred" to the browser(WebView), and that you must write logic to handle situations where you need to work in the background.

@n1705771
Copy link

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants