Android Phone screen

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.