1

I have an application in landscape orientation. This is how the manifest looks like:

<activity android:name="Activity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:launchMode="singleTask" android:screenOrientation="landscape" android:configChanges="keyboardHidden"> </activity>

When I lock and unlock the device the orientation changes to portrait for half of second and then goes to landscape. I noticed that this is not happening on all devices. I could reproduce it on Samsung Galaxy SI. Any ideas what can it be?

Adding "orientation|screenSize" to configChanges does not fix the issue.

EDIT:

Basically, the layout is losing its orientation when I slide the unlock screen(specially on Samsung devices) because it's taking the orientation of the slide activity which is portrait.

addru
  • 143
  • 1
  • 1
  • 10
  • What if you try to lock it using code. Check out this link: http://stackoverflow.com/questions/12266315/lock-android-screen-orientation-to-landscape – Bet Oct 29 '13 at 14:37
  • I'm not sure if I need that, I only want to get rid of the half second when the screen loses landscape orientation after unlocking. – addru Oct 30 '13 at 13:17

2 Answers2

0

Changing the name of the layout folder to "layout-land" may fix this by only allowing drawing in landscape

M Allen
  • 31
  • 5
0

You need to add the below properties in the activity tag of manifest you want,,,rather than adding your application tag

<activity
        android:name="com.example,MainActivity"
        android:configChanges="keyboardHidden|orientation"
        android:screenOrientation="landscape"
        android:windowSoftInputMode="adjustPan" >
    </activity>

Or if this do not work,,, then add this code just below the setContentView() in your Activity

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
Akhilesh Sk
  • 451
  • 4
  • 18
  • I had added it in activity tag, not in application tag, but it did not made any difference. – addru Oct 30 '13 at 12:57
  • I have tried with setRequestedOrientation, but it did not worked. Please see my edit. – addru Oct 30 '13 at 13:33