Orientation Android 4.x with telephony

I have a web application with a phone 1.3 and jquerymobile 1.0 that works well on all versions of Android, but 4.0 In fact, if I change the orientation, the power of the application is rounded off without errors and there are no (as I understand it) logcat errors. If I open my application in portrait work, if I open in landscape work, but if I try to switch the closure

Here is my code:

import android.os.Bundle; import com.phonegap.DroidGap; public class MYActivity extends DroidGap { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.loadUrl("file:///android_asset/www/index.html"); } } 

of course it's me

  android:configChanges="keyboardHidden|orientation" android:screenOrientation="sensor" 

in the manifest!

thanks for the help

+1
source share
2 answers

Try adding this:

 android:configChanges="orientation|screenSize|keyboardHidden" 

as a configuration change parameter to see if it fixes your problem.

+6
source

I had the same problem with rotation, and I got an app for the latest version of sdk 4.03, and the above configuration changes. My manifest is as follows:

 <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> 
+1
source

All Articles