开发者

Android - Changing screen orientation

Suppose that within an activity my initial screen orientation is landscape. In the开发者_如何学运维 same activity, I would like to add a button which changes the screen orientation from landscape to portrait.

Is this possible in any way, or should I switch to a new activity ?

Thanks.


Use Activity.setRequestedOrientation() method


you can add new views to your layout, but first you need to detect the orientation change which is explained in the following link how it's done.

How to detect orientation change in layout in Android?

hope this helps

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜