How to do this, use the new method setTaskDescription(...)in the Activity class. It can be used to set the task name and task icon to display the latest applications on the screen. A class is used to set these values ActivityManager.TaskDescription. See the example below. Please note that all this code belongs to an activity whose task description you want to change.
Bitmap recentsIcon; // Initialize this to whatever you want
String title; // You can either set the title to whatever you want or just use null and it will default to your app/activity name
int color; // Set the color you want to set the title to, it a good idea to use the colorPrimary attribute
ActivityManager.TaskDescription description = ActivityManager.TaskDescription(title, recentsIcon, color);
this.setTaskDescription(description);
Check out the documentation for the ActivityManager.TaskDescription class , as well as this article about using the class.
source
share