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 (e.g 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.
Related
I'm trying to create an android app with a fixed landscape orientation so I updated the manifest to include the following
activity android:name=".MainActivity"
android:screenOrientation="sensorLandscape"
This worked perfectly on a Pixel 2 phone, but when I opened the app on a Nexus 9 Tablet the orientation matched the rotation of the device as if I had done nothing.
Why is this happening and what can I do to resolve the issue?
I'm fairly novice, so please keep things simple.
cheers
Try adding
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
to your OnCreate method and see what happens
I'm working on a libGDX application and based on this question I'm forcing portrait orientation in activity tag of AndroidManifest.xml like this:
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
This used to work fine on my devices until my Samsung Galaxy S4 got upgraded to Lollipop (5.0.1) from KitKat. Now it doesn't work on this device, while still working on others (with lower Android versions). On the S4 it just displays the application in landscape, ignoring rotation.
I was looking for differences in the 5.0 API that could explain this, but couldn't find anything.
Edit: I've just tried exporting my app to .apk and it displayed properly. Previously I was running it from Eclipse debug mode. It shouldn't be hard to pinpoint the issue, but I don't have time to investigate it at the moment.
Edit2: I've just tried running it from Eclipse on a different machine, where I have API 21 (so Lollipop) and it worked. However my working .apk has been exported on another machine, where I have API 20. It's really puzzling me. Might be something related to Android plugin versions, but I'm not sure if I will be able to pinpoint it.
try
android:screenOrientation="sensorPortrait"
I am not sure what your API level. But there was a google bug around this issue, which was fixed by API 16. If you are using anything earlier and if above line does not work, try
android:screenOrientation="sensorPortait"
instead.
Text in my app's WebViews display very blurry on Android 4.4. Works fine in prior versions of Android. Also displays properly after I rotate the device (even if I rotate back to the original orientation.) Anyone know what is causing this?
Here's a screenshot:
It seems that the hardware acceleration was causing the problem. Adding
android:hardwareAccelerated="false"
in the AndroidManifest.xml for the particular activity made the problem go away.
http://developer.android.com/guide/topics/graphics/hardware-accel.html#controlling
https://code.google.com/p/android/issues/detail?id=26374&q=blurry&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars
I want my application to work in Portrait & reversePortrait mode .. In other words, I want it to work in portrait and make it rotatable 180 degrees!
I'm using the following code within <activity> tag of the MainActivity in the Manifest.
android:screenOrientation="sensorPortrait"
However, this seems to work only on Android 4.1.2 and backward.
It doesn't work on Android 4.2.2 and above!
I tried on different phones, the same result! How to solve it?
I'm aware of a typo error by Google that replaced sensorPortrait by sensorPortait at some point.
Not sure if that is your case, but depending on your targetApi, it might.
Use sensorPortait and see what happens at compilation.
This has been fixed in API 16.
Actually my problem is the same as the question posted in :
the same problem
But there is no answer yet..
Here is the problem I got :
I've just built an application using sencha touch & phone gap. It runs well on my galaxy tab but when I rotate it to portrait or landscape, it is going crash.
I have added :
android:configChanges="orientation|keyboardHidden"
on my manifest file but it is still going crash when I rotate it.
I don't know how could this happen.
Could someone help me?
Note :
I'm using
- Galaxy tab
- Sencha-touch 1.1
- Phone gap 1.2
You should have
android:configChanges="keyboardHidden|orientation|screenLayout"
instead of
android:configChanges="orientation|keyboardHidden"
to your activity in the manifest
Might be a bit late... but since I've recently been trying this, I found that specifying
android:configChanges="orientation|screenSize|keyboardHidden"
works where as
android:configChanges="keyboardHidden|orientation|screenLayout"
does NOT.
I'm using cordova 2.0.0.