Android: screenOrientation = "sensorPortrait" does not work on API +17

I want my application to work in Portrait and reversePortrait mode. In other words, I want him to work in a portrait and make it rotate 180 degrees!

I am using the following code in the <activity> MainActivity tag in the manifest.

android:screenOrientation="sensorPortrait"

However, it seems that this only works on Android 4.1.2 and vice versa.

It does not work on Android 4.2.2 and higher!

I tried on different phones, the same result! How to solve it?

+4
source share
1 answer

Google, - sensorPortrait sensorPortait.

, , targetApi .

sensorPortait , .

API 16.

+3

Source: https://habr.com/ru/post/1537085/


All Articles