2

I am attempting to change my home icon to a drawable. I am using the following code:

getSupportActionBar().setIcon(R.drawable.some_image);

This is not working! I have the image set in my theme, so perhaps this can not be overridden...

I have tried on gingerbread and honeycomb so far...

Patrick Jackson
  • 18,766
  • 22
  • 81
  • 141
  • What happens when you temporarily remove it from your theme? – Krylez Aug 02 '12 at 18:10
  • It still does not work when removing from theme. I did get it to work by changing a few things...Trying to nail down what the problem was and then will post an answer. – Patrick Jackson Aug 02 '12 at 18:31

1 Answers1

6

The problem was I had the declared a logo in the android manifest with the following line:

<application
   ....
   android:logo="@drawable/some_icon">
</application>

The icon declared in my theme was overriden by getSupportActionBar().setIcon().

For more info on icon vs logo see this SO: Android icon vs logo

Community
  • 1
  • 1
Patrick Jackson
  • 18,766
  • 22
  • 81
  • 141