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.
Add the following code in your action bar styles:
<item name="android:displayOptions">showHome|homeAsUp|showTitle</item>
<item name="displayOptions">showHome|homeAsUp|showTitle</item>
<item name="android:icon">@android:color/transparent</item> <!-- This does the magic! -->
PS: I'm using Actionbar Sherlock and this works just fine.
If you do not want the icon in particular activity.
getActionBar().setIcon(
new ColorDrawable(getResources().getColor(android.R.color.transparent)));
If you've defined android:logo="..."
in the <application>
tag of your AndroidManifest.xml
, then you need to use this stuff to hide the icon:
<item name="logo">@android:color/transparent</item>
<item name="android:logo">@android:color/transparent</item>
The use of these two styles has properly hidden the action bar icon on a 2.3 and a 4.4 device for me (this app uses AppCompat).
This worked for me
getActionBar().setDisplayShowHomeEnabled(false);
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