Home » Android » Android 5.0: howto change Overview Screen Task Title background color

Android 5.0: howto change Overview Screen Task Title background color

Posted by: admin June 15, 2020 Leave a comment

Questions:

The new Android 5.0 Lollipop Overview Screen features each App’s Task with a screenshot and a (by default) grey title bar.

Some Lollipop Apps (For example the new Play Store) use different colours. How can the colour of the Overview Screen title background be changed?

Android Overview Screen, Creative Commons Attribution 2.5

How to&Answers:

In general, if you’re targeting Material then you should set colorPrimary (action bar, recents), colorPrimaryDark (status bar), and colorAccent (check boxes, progress bars, etc) in your theme.

That said, you can dynamically change the recents color to be something else using:

TaskDescription taskDesc = new TaskDescription(myTitle, myIcon, myColor);
myActivity.setTaskDescription(taskDesc);