Android 5.0: how to change recent apps title color?

You can't force the text color, it is auto generated (either white/black) based on your colorPrimary color.


I also looked into this and the best way I could find was (suggestion from MrEngineer13) setting my recents app color to the 600-value of my primary color:

Bitmap bm = BitmapFactory.decodeResource(getResources(), app_icon);
TaskDescription taskDesc = new TaskDescription(getString(R.string.app_name), bm, getResources().getColor(R.color.primary_600));
MainActivity.setTaskDescription(taskDesc);

If you look closely at the Android 5.0 contacts app, you can see that Google themselves is also doing something similar:

Screenshot Android contacts

Therefore I believe it is impossible to change the title color yourself, but Android will choose a good one for you. (which will also allow Android to change it for accessibility reasons,...)


To change the color/title/icon you just need to use the following:

TaskDescription tDesc = new TaskDescription(mTitle, mIcon, mColor);
MainActivity.setTaskDescription(tDesc);