Phonegap 设备就绪事件
我有一个关于此事件的问题,deviceready。
document.addEventListener('deviceready', function() {
app.init();
}, false);
看来每次设备(我正在使用 Android 2.3)向侧面倾斜(以便显示变为宽屏)时都会触发该事件。我想这是预期的行为,但是有什么方法可以阻止它,因为我的应用程序只需要初始化一次?
I have a question regarding this event here, deviceready.
document.addEventListener('deviceready', function() {
app.init();
}, false);
It appears the event is fired every time the device (I'm working on Android 2.3) is tilted to the side (So that the display changes to wide). I guess this is the intended behavior, but is there any way to prevent it, as my application needs to be initialized only once?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下是解决方案的链接
如何在 Android 上禁用方向更改?
通过添加
到 AndroidManifest.xml 文件中的 Activity,它告诉应用程序您将自己处理 configChanges。
Here is a link to the solution
How do I disable orientation change on Android?
By adding
to your activity in the AndroidManifest.xml file, it tells the app that you will handle the configChanges yourself.