App running in Background

Is there a way for the app to know as soon as it starts running in the background on a phone?

Thanks

Kind of. The window.onbeforeunload event is for that. I understand that it is not 100% reliable, however, so your mileage may vary.

http://wiki.nsbasic.com/Window

Kind regards,
Doug

There may also be a PhoneGap library which could help you.

Thanks. Unfortunately, i couldn’t get any of the window objects to work. I’ll keep trying!