Full Screen setting for Android

Source: Internet
Author: User

From: http://www.myexception.cn/android/448805.html

Set full screen for Android

Hide the title bar:
requestWindowFeature(Window.FEATURE_NO_TITLE);

 

Beyond the permitted range (ignore the status bar ):
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

 

Enter full screen:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

 

Cancel full screen:
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
In Android4.0The above method is invalid. You can try the following method: Enter full screen
WindowManager.LayoutParams params = getWindow().getAttributes();params.systemUiVisibility =View.SYSTEM_UI_FLAG_SHOW_FULLSCREEN;getWindow().setAttributes(params);

 

Cancel full screen
WindowManager.LayoutParams params = getWindow().getAttributes();params.systemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE;getWindow().setAttributes(params);

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.