Saturday , February 23 2019
Home / Android / Android Screen Orientation Example

Android Screen Orientation Example

The screenOrientation is the attribute of activity element. The orientation of android activity can be portrait, landscape, sensor, unspecified etc. You need to define it in the AndroidManifest.xml file. For example:

The common values for screenOrientation attribute are as follows:

Value Description
unspecified It is the default value. In such case, system chooses the orientation.
portrait taller not wider
landscape wider not taller
sensor orientation is determined by the device orientation sensor.

Android landscape mode screen orientation example

1) activity_main.xml


3)  AndroidManifest.xml



About admin

Check Also

Android Activity Launch Modes

Launch mode is an instruction for Android OS which specifies how the activity should be ...

Leave a Reply