Reputation: 1
Is there a way to hide the app icon from the ActionBar; that is, have an ActionBar without an icon?
Here is my current code:
public boolean onCreateOptionsMenu(Menu menu) {
ActionBar actionBar = getSupportActionBar();
actionBar.setBackgroundDrawable(
new ColorDrawable(Color.parseColor("#000000")));
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setTitle(" OrderIn");
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setIcon(R.drawable.actionbar_logo);
return true;
}
Upvotes: 0
Views: 317
Reputation: 2370
If you've defined android:logo="..." in the 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).
Upvotes: 2