1 <?XML version= "1.0" encoding= "Utf-8"?>2 <Manifestxmlns:android= "Http://schemas.android.com/apk/res/android"3 Package= "Com.sowsceo.rnadomsows">4 5 <Application6 Android:allowbackup= "true"7 Android:icon= "@mipmap/ic_launcher"8 Android:label= "@string/app_name"9 android:screenorientation= "Landscape"Ten Android:supportsrtl= "true" One Android:theme= "@style/apptheme" A > - <Activity - Android:name=". Mainactivity " the Android:launchmode= "Singletask" - android:screenorientation= "Landscape"> - <Intent-filter> - <ActionAndroid:name= "Android.intent.action.MAIN" /> + - <categoryAndroid:name= "Android.intent.category.LAUNCHER" /> + </Intent-filter> A </Activity> at <ActivityAndroid:name= ". Produce. Activityrandom " /> - </Application> - </Manifest>
Forces the horizontal or vertical screen of each activity, that is, when the user sets the phone to "auto-rotate", the interface that has been forced to screen or vertical screen is not valid,
Question: How to make the Activiy interface mandatory!
Answer:
In the Androidmanifest.xml file, set the <activity></activity>
1 <ActivityAndroid:name= ". Produce. Activityrandom "2 Android:launchmode= "Singletask"3 android:screenorientation= "Landscape"/>4 5 launchmode/screenorientation Two parameters of the set, indispensable6 7 android:launchmode= "Singletask"8 parameter Description, click it in detail http://2960629.blog.51cto.com/2950629/7012279 Ten android:screenorientation= "Landscape" OneLandscape is horizontal, portrait is portrait
[Android] Force activity of the horizontal screen and the vertical screen