Multi-tasking capabilities that are now available on mobile devices specify that the user has the ability to switch from one application to another at any time. We need to handle this possibility and ensure that we can save and restore any processes and data when the user returns to our application.
We can use the PhoneGap API to detect when our application is brought back into the foreground on the device. The following steps will help us to do so:
xui.jsfiles. We will also be setting the
devicereadylistener once the DOM has fully loaded, so let's apply an
onloadattribute to the
<!DOCTYPE HTML> ...