Reputation: 1
I have a problem changing the orientation of the device (Android 4). In other versions it works fine. Versión of Cordova: cordova-1.8.0.js / cordova-1.8.1.js In Android 4 the app crash or show: "A network error occurred. (file:///android_asset/www/index.html)" I searched a lot about this and no answer solves the problem.
In most cases users suggest adding: android:configChanges="orientation|keyboardHidden|screenSize"
In other cases: super.setIntegerProperty("loadUrlTimeoutValue",60000);
That not work for me :(
My manifest activity:
<activity
android:name=".AppNameActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
The application should run on Android 2.2 to 4.
Thank you very much for the help.
Upvotes: 0
Views: 2185
Reputation: 21
I am having the exact same problem. It worked for me on phonegap 1.3.0, but the upgrade to cordova 1.8.1 or 1.9.0 created the same problem. The only solution I have found is to avoid the change of orientation, by adding screenOrientation as follows
<activity
android:name=".AppNameActivity"
android:screenOrientation="portrait"
android:label="@string/title_activity_app"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Upvotes: 2