Third, Android set horizontal screen or vertical screen: (a), Full screen: Add the following code before the Setcontentview (MyView) call in the activity's OnCreate method: Requestwindowfeature ( Window.feature_no_title);//Hide title GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//Set Full screen (b), horizontal screen: 1, Practice 1: Modify Activity's Onresume (): @Overrideprotected void Onresume () {//set to Horizontal if (getrequestedorientation ()! = Activityinfo.screen_orientation_landscape) { Setrequestedorientation (Activityinfo.screen_orientation_landscape); } super.onresume ();} 2. Procedure 2: Add the Android:screenorientation attribute to the Activity node in the configuration file (landscape is landscape, portrait is portrait) android:launchmode= "Singletask" android:screenorientation= "Portrait" >3, determine whether the screen is a horizontal screen or vertical screen method: if (Getresources (). GetConfiguration (). Orientation = = Configuration.orientation_landscape) { //screen} else if (Getresources (). GetConfiguration (). ORIENTATION = = configuration.orientation_portrait) { //Vertical Screen} (iii), vertical screen: to be set to a vertical screen set to screen_orientation_portrait
Android Phone screen