문제

I want to run my application always in portrait mode. I searched and found the code below, then I added to manifest file.

android:configChanges="orientation"
android:screenOrientation="portrait"

but my application still chancing orientation when I press CRTL+F12 on AVD. How can I force my application always run in portrait mode?

Ps: I tried the code reverse. (Second line first then first line)

도움이 되었습니까?

해결책

Did you add that in the activity element, not the application element?

 <activity 
    android:screenOrientation="portrait"  
    android:configChanges="orientation|keyboardHidden" >
 </activity>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top