Reputation: 265
I've been searching for a while now, and can't find anything for this with Phonegap only for Android or IOS.
So would be nice if someone knew how or if its even possible. Is there a way to check if the phone is in use/active, or if the phone is inactive/screen locked etc.?
Thanks
Upvotes: 8
Views: 2679
Reputation: 116
Yes, you can accomplish this by using two of the built-in phonegap events:
Example:
document.addEventListener("pause", yourCallbackFunction, false);
An example would be:
document.addEventListener("resume", onResume, false);
function onResume() {
// Handle the resume event
}
Hope that helps!
Upvotes: 5