Blog Details

img
Design

How to automatically screen orientation android

Spoke Right / 20 Nov, 2023

How to automatically screen orientation android

Screen Orientation Android

The screenOrientation is the attribute of activity element. The orientation of android activity can be portrait, landscape, sensor, unspecified etc.

Being the attribute of the activity element, the screen Orientation allows the orientation of an android activity.

The orientation type is defined in the AndroidManifest.xml

Common values for screenOrientation attribute:

ValueDescription
unspecifiedBeing the default value, the system chooses the orientation.
portraitThe orientation is taller not wider.
landscapeThe orientation is wider, not taller.
sensorThe orientation is specified by the device orientation sensor.

Android Portrait and Landscape mode screen orientation example:

Here we are going to create two activities with different screen orientations.

0 comments

Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0