これは私のコードです
//This is an event that fires when a PhoneGap application is put into the background.
document.addEventListener("pause", onPause, false);
//This is an event that fires when a PhoneGap application is retrieved from the background.
document.addEventListener("resume", onResume, false);
// Handle the pause event
function onPause(){
console.log("pause : app is put into background");
}
// Handle the resume event
function onResume() {
console.log("resume : app is put into foreground");
}
ホームボタンを押すと、コンソールにログはありませんが、アプリをクリックすると(フォアグラウンドにします)、ログは
2011-11-22 12:11:37.206 Event[644:207] [INFO] pause : app is put into background
2011-11-22 12:11:37.206 Event[644:207] [INFO] resume : app is put into foreground
フォアグラウンドになったときに一時停止関数が呼び出される理由がわかりません。
私が間違っていることはありますか?