How to adjust screen orientation for other applications?

With the following lines, we can set the orientation in the application.

setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

If I want to set the orientation on each screen (not only in the application). How can i do this? Any help.

Thanks in advance

+3
source share
1 answer
 setRequestedOrientation(0);
       or
 setRequestedOrientation(1);

horizontal (landscape) - 0 vertical (potrait) - 1

You can try this.

Or you can try it on your way. In the onCreate method of this activity, which orientation you want to change, put this code in this. This will change the orientation of the layout.

0
source

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


All Articles