0
How to force the Paiage/Landscape position on my Activity forever active and lock the Portrait/Portrait position. I want my app to already start in landscape position and can’t turn to portrait position.
0
How to force the Paiage/Landscape position on my Activity forever active and lock the Portrait/Portrait position. I want my app to already start in landscape position and can’t turn to portrait position.
3
In your Activity you need to put the following code in the onCreate method:
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE);
Thus remaining:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sua_activity);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE);
2
Hello, this can also be done on Androidmanifest, no need to do it in the code:
<activity
android:name="..."
android:label=".."
android:configChanges="orientation"
android:screenOrientation="portrait">
Browser other questions tagged android android-activity android-manifest
You are not signed in. Login or sign up in order to post.
Thanks buddy, it worked 100%
– Dennis Wadson