Phonegaps イベントの「一時停止」を使用して再開すると、これが役立つと思います。例えば:
document.addEventListener("pause", onPause, false);
function onPause() {
// Handle the pause event
}
リンク
完全な例
<!DOCTYPE html>
<html>
<head>
<title>Cordova Pause Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-2.1.0.js"></script>
<script type="text/javascript" charset="utf-8">
// Call onDeviceReady when Cordova is loaded.
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
// Cordova is loaded and it is now safe to make calls Cordova methods
//
function onDeviceReady() {
document.addEventListener("pause", onPause, false);
document.addEventListener("resume", onResume, false);
}
function onResume() {
// Handle the resume event
}
// Handle the pause event
//
function onPause() {
}
</script> </head> <body onload="onLoad()"></body> </html>