Reputation: 804
I've seen lots of references or similar questions, but all of them teaches me to do this: Add "android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" into the
But it's done and on orientation change, the app crashes. I tried to follow every single tip and it doesn't work.
This is my manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.guia.peixe"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"
android:anyDensity="true" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
This is the final version of the code, when it's done, I get an error:
Description Resource Path Location Type error: Error: String types not allowed (at 'configChanges' with value 'orientation|keyboardHidden|keyboard|screenSize|locale'). AndroidManifest.xml /Guia do Peixe line 34 Android AAPT Problem
But the example on Cordova's documentation points out to this, and no change I make into the string correct the error.
Thank you
Upvotes: 0
Views: 3647
Reputation: 23273
That's because your XML is not valid. It should be:
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">
Note, you have the > in the wrong position.
Upvotes: 4