Stopping Javascript / angular watches when app paused


#1

When user leaves application (application goes in background) application still consumes CPU (on android).

I think angular watches/evnethanlders are running.

I can define event handlers for pause and resume events like

document.addEventListener("resume", onResume, false);
document.addEventListener("pause", onPause, false);

But how to stop and resume Javascript execution.??


#2

I found possible solution (keepruning preference) http://cordova.apache.org/docs/en/3.4.0/guide_platforms_android_config.md.html#Android%20Configuration


#3

Yep. This is a problem I’m currently facing – how to make sure HTML5 video playback is paused when the app pauses