Hide android status bar for my application on Android 4.0.4?
15,351
Solution 1
Use the following in your Manifest
<activity
android:name=".abc"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
This however will only work on phones, Tablets do not support hiding of status bar.
Solution 2
Try with this on your onCreate
method.
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Solution 3
- add a style and extend Theme.AppCompat.NoActionBar , and add two item.
like this
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style
- setup your application with this theme.
like this
<application
...
android:theme="@style/AppTheme"
...>
</application>
Author by
Arjun Kanti
Updated on June 14, 2022Comments
-
Arjun Kanti almost 2 years
I tried with the following code to hide status bar but it doesn't work..
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
and to dim the bar i used
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
and it works.. Does any one know how to hide status bar on Android 4.0.4 device??
-
Arjun Kanti over 11 yearsOkay.. ('m using Android Network Media Player 4.0 device) .. But i downloaded a GMD HideBar 1.1.3.apk file from Link and installed, it works.. Actually it hides status bar but problem is sometimes device will be restarted and sometimes it won't hide bar.
-
Raj over 11 yearsTHe above code should work correctly, you do however need to keep in mind you need to add the above code to each activity you have.
-
PsychoMantis about 11 yearsThis method worked for me. Its worth noting that I do have my current app restricted to landscape orientation though.