With the addition of Lollipop, it appears you can now change the color of this window when changing apps. I don't know what it is called and therefore can't find any info on it but if you look at the image you can see that the Keep app is now yellow.
How do I go about changing this color?
Here is a link to the image, it won't let me attach it since I'm new
Thanks
Simply put this code into the
onCreate
method of your target activity:Please be aware that the code above requires API level 21 (Android 5.0 Lolipop) or higher. In case you need to support older devices as well, you can surround the code with following condition:
Also be aware that you will need to set the colour of top bar in every activity, otherwise your color will be reset when launching another activity. (You can ease this problem by putting the code into some kind of BaseActivity, from which other Activities will inherit.)
Helpful article about this topic: https://www.bignerdranch.com/blog/polishing-your-Android-overview-screen-entry/
1.normal way
2.reflected
You can use setTaskDescription() to achieve this:
For android documentation:
https://developer.android.com/reference/android/app/Activity.html#setTaskDescription(android.app.ActivityManager.TaskDescription)