0

I created an android app which requires the screen to be only in portrait mode. While typing the IDE showed only this for orientation.

android:orientation="vertical"

The above code actually worked in the emulator. But when I checked it on a physical device. The app is rotating to landscape even with that code. How do I solve this?

I checked for screenOrientation is not working. Thanks in advance

Ruthvik
  • 790
  • 5
  • 28

1 Answers1

3

Add this line in your manifest android:screenOrientation="portrait"

<activity
    android:name=".LoginActivityKt"
    android:screenOrientation="portrait"/>

For Example :

enter image description here

Tippu Fisal Sheriff
  • 2,177
  • 11
  • 19