G.S
G.S

Reputation: 257

How to refresh or reset the app in phonegap+jquery mobile?

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

Answers (1)

Jasper
Jasper

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

Related Questions