I want to disable status bar or notification bar in android. I use android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
for disable it but it makes my title bar disable too. how can I only disable status bar?
Head onto Android Settings -> Advanced Restrictions -> Display Settings -> Enable Modify System Bars -> Enable Hide Status Bar. If the devices are in Kiosk mode, you could disable the status bar from Kiosk Settings -> Peripheral Settings -> Enable status bar under Display settings.
Make a base activity with below code in onCreate function and extend that activity every time
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
Or
you can have above code in every activity for having Title bar visible but status bar invisible.
EDIT: Just make sure you don't define any theme in your Android Manifest.
Use the full screen theme in your manifest and then You can defined a separate layout with your title in it then use the include tag on every layout in your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With