简体   繁体   中英

Android Orientation phonegap version

I'm making an Android app using Eclipse, phonegap (version 2.1.0) and html5.

I'm encountering a problem with the orientation of the app. When I rotate the mobile, on landscape mode, the app crashes. I looked to the other posts and applied the methode that seems to work for others (eg android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale") but the app continue to crash.

And when I try this : android:configChanges="orientation|keyboardHidden" , the app doesn't crash in landscape mode but don't come back to portait mode!

My minimum required version is android 2.3.3 for the app.

Does anyone have already encoutered this problem and solve it for Android 2.3.3? I'm kind lost and don't know what other solution to test.

Thanks

Kraken

UPDATE: Something I forgot to say is that I'm working only on the emulator. I don't have a device with android 2.3.3 so that I could test my app.

Make sure that for all of your activities you set at least the below code:

Do you have a splash screen maybe that doesnt have it or an admob or other advertisement view on it?

<activity android:name="main" android:launchMode="standard" android:configChanges="orientation|keyboardHidden"></activity>

Also make sure that you save your instance when rotating in your webview like described in this post: Android WebView: handling orientation changes

If it then still crashes please provide some log file to show the error it is having.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM