Search code examples
androidxmlandroid-layoutandroid-actionbartitlebar

Remove icon/logo from action bar on android


I've been trying to find some way of removing the icon/logo from the action bar but the only thing I've found after an hour of searching SO, Android's documentation and Google is how to remove the title bar in whole. That is not what I want. Only want to remove the icon/logo from the title bar.

Any one know how to accomplish this? Preferably I'd like to do this in XML.


Solution

  • 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:

    pre-v11 theme

    <item name="logo">@android:color/transparent</item>
    

    v11 and up theme

    <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).