RiksAndroid
RiksAndroid

Reputation: 825

Landscape mode creating issues in app

I had an application of timer and my app should always be in landscape mode. In manifest, I had used:

<activity android:name=".MActivity"                      
  android:label="@string/app_name"           
  android:screenOrientation="landscape" 
  android:theme="@android:style/Theme.NoTitleBar"
  android:configChanges="keyboardHidden|orientation"> 

But sometimes, when I switch from background to foreground, it first appears in portrait mode and then resizes to landscape mode. What's happening here?

Thanks in advance.

Upvotes: 0

Views: 212

Answers (2)

mthpvg
mthpvg

Reputation: 3809

Do you have the same situation if you paste this line in every of your activities (in the onCreate):

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

Upvotes: 1

Pinki
Pinki

Reputation: 21919

use android:configChanges="keyboard|keyboardHidden" not the orientation for this attribute

Upvotes: 0

Related Questions