开发者

Phonegap deviceready event

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 开发者_如何学Pythondisplay 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?


Here is a link to the solution

How do I disable orientation change on Android?

By adding

android:configChanges="keyboardHidden|orientation"

to your activity in the AndroidManifest.xml file, it tells the app that you will handle the configChanges yourself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜