Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 242
G.S Avatar asked Nov 18 '11 16:11

G.S


1 Answers

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);
like image 68
Jasper Avatar answered Nov 10 '22 23:11

Jasper