Changing the Action bar icon

前端 未结 7 1545
栀梦
栀梦 2020-12-10 15:44

I\'m currently implementing theme support for my application and a part of it is changing the action bar app icon. I want to use a dark icon when Holo Light is selected. Eve

相关标签:
7条回答
  • 2020-12-10 16:43

    The existing answer is very correct. There is, however, also an alternative. A minimal approach would be to use

    getActionBar().setIcon(R.drawable.my_icon);

    Gets your job done right away. :)

    Technical Details: Since getActionBar() by default returns an object, you can directly manipulate it without having to receive it in an in-scope object explicitly.

    0 讨论(0)
提交回复
热议问题