androidandroid-titlebar

android - How to Hide the stausbar


I set the following property in application tag of manifeast file. but it hides both titlebar(Actionbar) and Statusbar.Here i want to hide only the statusbar.

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"


Solution

  • for hiding only status bar add this code in oncrete of activity:

    // Hide the Status Bar
     
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
     
    WindowManager.LayoutParams.FLAG_FULLSCREEN);
    

    and remove android:theme="@android:style/Theme.NoTitleBar.Fullscreen" from manifest