I what my actionbar to have a title and homeAsUp but not the logo or icon.
like this:
Open your styles.xml file and add below codes in your Actionbar style
<item name="android:displayOptions">showHome|homeAsUp|showTitle</item>
<item name="displayOptions">showHome|homeAsUp|showTitle</item>
<item name="android:icon">@android:color/transparent</item> <--this do the magic!
p/s: I'm using Actionbar Sherlock and this works just fine
getActionBar().setIcon(
new ColorDrawable(getResources().getColor(android.R.color.transparent)));
it works for me.
To hide the icon as well try using setIcon(null)
actionBar = getSupportActionBar();
actionBar.setTitle("My Profile");
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setIcon(null);
actionBar.setHomeButtonEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setTitle("My Profile");
actionBar.setDisplayUseLogoEnabled(false);
If you do not want the icon in particular activity.
getActionBar().setIcon(
new ColorDrawable(getResources().getColor(android.R.color.transparent)));
To hide action bar icon following methods works for me
method-1:getActionBar().setIcon(android.R.color.transparent);
method-2:getActionBar().setIcon(null);