2

I'm using navigation drawer in my application. I want to get rid of the android's robot icon from the action bar. I'm using the following lines but the logo is not disappearing.

actionBar.setDisplayHomeAsUpEnabled(true); 
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayShowTitleEnabled(false);

Can anyone suggest me what should I do?

Anita
  • 49
  • 2
  • 11

4 Answers4

1
getActionBar().setLogo(new ColorDrawable(getResources().getColor(android.R.color.transparent)));

Works as well.

0

to hide the logo add below line also

actionBar.setDisplayShowHomeEnabled(false);

See this link also Android remove app icon action bar

Community
  • 1
  • 1
Giru Bhai
  • 14,370
  • 5
  • 46
  • 74
0

Just add this to your activity

getActionBar().setIcon(new ColorDrawable(getResources().getColor(android.R.color.transparent)));

MrEngineer13
  • 38,642
  • 13
  • 74
  • 93
0

This will done the magic:

1.) Add the following lines into your styles.xml:

   <style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
        <item name="android:actionBarStyle">@style/AppTheme.ActionBar</item>
    </style>

    <style name="AppTheme.ActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid.Inverse">
        <item name="android:displayOptions">showHome|homeAsUp|showTitle</item>
        <item name="android:icon">@android:color/transparent</item>
    </style>

    ...

2.) And don't forget to add your style into your AndroidManifest.xml (if you haven't already done it):

    <application
        android:theme="@style/AppTheme"
        android:label="@string/app_name"
        android:icon="@drawable/ic_launcher"
        ...

Hope this helps!

Robin
  • 709
  • 2
  • 8
  • 20