我正在开发一个应用程序,其中用户需要在设置页面上设置一些参数,然后用户移动 slider (位于应用程序的主页上),结果显示在主页上。 但执行计算后,当我按下 iPhone 模拟器的主页按钮并再次打开应用程序时。它显示相同的选定设置和所有内容。 我应该如何刷新它或重置所有内容?
最佳答案
您可以将事件处理程序绑定(bind)到 PhoneGap 公开的 pause
或 resume
事件。文档可以在这里找到: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);
关于jquery - 如何在phonegap+jquery mobile中刷新或重置应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8185565/