Android 4.x orientation with phonegap

前端 未结 2 1117
小蘑菇
小蘑菇 2021-01-07 10:58

I\'ve a web app with phonegap 1.3 and jquerymobile 1.0 that works well on all android version but 4.0 In fact if I change the orientation the app force close with no errors

相关标签:
2条回答
  • 2021-01-07 11:24

    Try adding this:

    android:configChanges="orientation|screenSize|keyboardHidden" 
    

    as your config change parameter to see if it fixes your issue.

    0 讨论(0)
  • 2021-01-07 11:41

    I had the same rotation problem and took the app to the latest version of the sdk 4.03, and the above mentioned configuration changes. My manifest looks like the following:

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="13" />
    
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".Ordering"
            android:configChanges="orientation|screenSize|keyboardHidden"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <!-- ZXing activities -->
        <activity
            android:name="com.google.zxing.client.android.CaptureActivity"
            android:configChanges="orientation|screenSize|keyboardHidden"
            android:screenOrientation="landscape"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:windowSoftInputMode="stateAlwaysHidden" >
            <intent-filter>
                <action android:name="com.phonegap.plugins.barcodescanner.SCAN" />
    
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.google.zxing.client.android.encode.EncodeActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/share_name" >
            <intent-filter>
                <action android:name="com.phonegap.plugins.barcodescanner.ENCODE" />
    
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>
    
    0 讨论(0)
提交回复
热议问题