Detailed explanation of Android horizontal and vertical screen switching life cycle

1、 Introduction

2、 Code

/activityLifeCycle_ 3Screen/AndroidManifest.xml

Core code: Android: configchanges = "keyboardhidden | orientation | screensize"

com.fry.activityLifeCycle_ 3Screen.MainActivity

3、 Always horizontal or vertical

Many mobile games have a horizontal screen as soon as they enter, and they can't switch to a vertical screen. So how to achieve this effect?

/activityLifeCycle_ 3Screen/AndroidManifest.xml

Android: screenorientation = "landscape" horizontal screen Android: screenorientation = "portal" vertical screen

4、 How to get whether the mobile phone is horizontal or vertical

com.fry.activityLifeCycle_ 3Screen.MainActivity

/activityLifeCycle_ 3Screen/AndroidManifest.xml

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>