Reputation: 257
I am developing an app in which user needs to set some parameters on settings page and then the user moves the slider (which is on home page of app) and the results are displayed on home page. But after performing the calculation, when i press the home button of iPhone simulator and again open the app.It is displaying the same selected settings and everything. How should i refresh it or reset everything?
Upvotes: 6
Views: 4250
Reputation: 76003
You can bind an event handler to the pause
or resume
events that PhoneGap exposes. Documentation can be found here: http://docs.phonegap.com/en/1.2.0/phonegap_events_events.md.html#Events
Resume
This is an event that fires when a PhoneGap application is retrieved from the background.
function onResume() {
//run code to reset your app here
}
document.addEventListener("resume", onResume, false);
Upvotes: 6