Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide status bar in android in just one activity

Tags:

I want to hide status bar / notification bar in splash screen I am using style:<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> this dose not hide the status bar, how should i do this?

like image 444
Kunal Dudka Avatar asked Mar 23 '17 06:03

Kunal Dudka


People also ask

How can I customize my Android status bar?

To customize it, first pull down the slider bar from the top of the screen. Next, tap on the three vertical dots in the top right corner. Now click on Status bar. You're in.


3 Answers

If you want to remove status bar then use this before setContentView(layout) in onCreateView method

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
    WindowManager.LayoutParams.FLAG_FULLSCREEN);

credits

like image 75
Kiran Benny Joseph Avatar answered Oct 02 '22 07:10

Kiran Benny Joseph


You can do something like below for appropriately setting theme on your particular activity -

<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
        <item name="android:windowBackground">@drawable/launch_theme</item>
        <item name="android:windowTranslucentNavigation">false</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowActionBar">true</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowDrawsSystemBarBackgrounds">false</item>
 </style>
like image 27
Bajrang Hudda Avatar answered Sep 30 '22 07:09

Bajrang Hudda


Try this:

<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
        <item name="android:windowFullscreen">true</item>
</style>
like image 4
Hiran A. Avatar answered Sep 30 '22 07:09

Hiran A.