我正在使用 iOS 4.3 在 iPhone4 中制作本机应用程序
在我的身体 onLoad 我添加
document.addEventListener("pause", Game.prototype.pauseListener.bind(this), false);
document.addEventListener("resume", Game.prototype.resumeListener.bind(this), false);
在同一个文件中我正在编写一个函数
Game.prototype.resumeListener= function()
{
console.log("in resumeListener");
this.PauseGame(false);
}
Game.prototype.pauseListener= function()
{
this.PauseGame(true);
}
此代码在 Android 中运行良好,当我手动最小化应用程序时,但当应用程序被语音来电中断时,应用程序不会暂停。
基本上暂停和恢复事件不会被触发。
我正在使用 Phonegap1.4.1