I'm trying to remove/disable the ActionBar. I tried to put in the Manifest:
<activity
...
android:theme="@android:style/Theme.NoTitleBar"
</activity>
and it doesn't work. It doesn't remove the ActionBar. Please help me. Thanks.
If you want to hide Action Bar from the entire application (from all Activities and fragments), then you can use this method. Just go to res -> values -> styles. xml and change the base application to “Theme. AppCompat.
If we want to remove the ActionBar only from specific activities, we can create a child theme with the AppTheme as it's parent, set windowActionBar to false and windowNoTitle to true and then apply this theme on an activity level by using the android:theme attribute in the AndroidManifest. xml file.
I had this issue too. I went to styles.xml
and changed
parent="Theme.AppCompat.Light.DarkActionBar"
to
parent="Theme.AppCompat.Light.NoActionBar"
and that removed it from all my activities.
in your oncreate()
method use this
getActionBar().hide();
If your minSdkVersion
is 10 or lower, instead use:
getSupportActionBar().hide();
You can try this. It works for me
Add it in style.xml
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
and use the style at manifest.xml.
android:theme="@style/AppTheme.NoActionBar"
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