My app has a logo that I can make either black or white. The launcher icon I have specified is black, and I would like to keep it that color. However, my application is using a dark theme, and the color of the app title bar in the recent apps stack is also black. The black icon on the black titlebar looks ugly, especially next to white text. Here is a screenshot to help explain:
Is it possible to specify a different icon for the launcher and task switcher?
EDIT: I see that Chrome does this: it changes it's task switcher icon to the current site's favicon, so unless that API is private, I know categorically this is possible.
Yes, starting from API 21 forward, we have an option to customize our app's representation in the Recent Apps screen using the
TaskDescription
API.If you only care about the icon, you can use this snippet below essentially anywhere from within an
Activity
:However, you have to keep in mind that your app's presentation on the Recent Apps screen is determined by the last
TaskDescription
you set.As quoted from Big Nerd Ranch's awesome article on this matter:
Hence to achieve the best result possible, you would want to put that snippet within your app's
MainActivity
'sonCreate(..)
method.