Android hidden problems with the top status bar _android

Source: Internet
Author: User

First look at the general way to hide the status bar:

Method One:

@Override
protected void onCreate (Bundle savedinstancestate) {
super.oncreate (savedinstancestate);
Remove TITLE
requestwindowfeature (window.feature_no_title);
Remove the status bar
GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Setcontentview (R.layout.video_view);
Initview ();
}

Pit 1: The code in the above setting hides the top status bar must be placed in Setcontentview (R.layout.video_view);

Method Two:

<activity
android:name= "*. Activity "
android:theme=" @android: Style/theme.notitlebar.fullscreen ">
</activity>

Will: Android:theme= "@android: Style/theme.notitlebar.fullscreen" This line of stacking is only valid for current activity in a separate activity, If you want the entire app to work, put it in application.

Pit 2:android:theme= "@android: Style/theme.notitlebar.fullscreen" This line of code, if configured in application, The entire app activity can only be inherited from the activity, cannot be appcompatactivity, because the appcompatactivity under the theme can only be actionbar style;

Pit 3:android:theme= "@android: style/ Theme.NoTitleBar.Fullscreen if this line of code is set only under one activity, then the other activity is arbitrary as long as it is ensured that the current activity is not an inheritance activity rather than an inherited appcompatactivity;

The above is a small series to introduce the Android hidden top status bar encountered problems, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.