Android System Status Bar integration

Source: Internet
Author: User

Android4.4 new features, System status bar integration.

The steps to be implemented include the following:

1.android4.4 or later

2. Set the app fullscreen:

Method: Set Android:theme= "@android: Style/theme.translucent.notitlebar" in Androidmanifest.xml

3. Load Nineoldandroids-2.4.0.jar

4. Implementation class: Set the status bar background to full transparency.

The project structure diagram is as follows:


The main method of invocation is implemented in Mainactivity.java as follows:

public class Mainactivity extends activity{@Overrideprotected void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); Settranslucentstatus (); Setcontentview (R.layout.activity_main);} /** * Sets the status bar background state */private void Settranslucentstatus () {if (Build.VERSION.SDK_INT >= build.version_codes. KITKAT) {Window win = GetWindow (); Windowmanager.layoutparams winparams = Win.getattributes (); final int bits = WindowManager.LayoutParams.FLAG_ Translucent_status;winparams.flags |= bits;win.setattributes (winparams);} Systemstatusmanager Tintmanager = new Systemstatusmanager (this); tintmanager.setstatusbartintenabled (true); Tintmanager.setstatusbartintresource (0);//status bar no background}}


Friends with this need can download and try.

Resource Address: http://download.csdn.net/detail/aiyuan0204/8485597

Note: This is a new feature of android4.4 and supports only 4.4 or more versions

Here are the following:


Android System Status Bar integration

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.