开发者

Phonegap deviceready event

开发者 https://www.devze.com 2023-04-11 22:01 出处:网络
I have a question regarding this event here, deviceready. document.addEventListener(\'deviceready\', function() {

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

精彩评论

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