How to set screen-orientation for other apps?

2019-04-12 12:44发布

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

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

If I want to set the orientation to every screen(not only with in application). how can i do this? Any help.

Thanks in advance

1条回答
姐就是有狂的资本
2楼-- · 2019-04-12 13:19
 setRequestedOrientation(0);
       or
 setRequestedOrientation(1);

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

You can try this.

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

查看更多
登录 后发表回答