Android screen Full screen implementation code _android

Source: Internet
Author: User
Remove the title bar:
Requestwindowfeature (Window.feature_no_title);
That's what the API says:
int Feature_no_title Flag for the ' NO title ' FEATURE, turning off the TITLE ' at the ' top ' screen.
Full screen:
GetWindow (). Addflags (WindowManager.LayoutParams.FLAG_FULLSCREEN);
That's what the API says:
int Flag_fullscreen Window flag:hide all screen decorations (e.g.
There is no boundary limit on the screen (allows Windows to be extended outside the screen):
GetWindow (). Addflags (WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
That's what the API says:
int flag_layout_no_limits window Flag:allow window to extend outside of the screen.
Usage:
Copy Code code as follows:

@Override
protected void OnCreate (Bundle savedinstancestate) {
TODO auto-generated Method Stub
Super.oncreate (savedinstancestate);
Requestwindowfeature (Window.feature_no_title);
GetWindow (). Addflags (WindowManager.LayoutParams.FLAG_FULLSCREEN);
GetWindow (). Addflags (WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
Setcontentview (r.layout.newslists);
Newslistlayout = Findviewbyid (r.id.newslistlayout);
Newslistlayout.setbackgroundcolor (Color.magenta);

Newsnamelist = (ListView) Findviewbyid (r.id.newsnamelist);
Model = new Model (0, 6);
Namelistadapter = new Newsnamelistadapter (this, model);
Newsnamelist.setadapter (Namelistadapter);

ShowPage = (TextView) Findviewbyid (r.id.newslistshowpage);
Updatepage (Model.getindex ());
}

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.