I am writing an Android App recently and I create several activities using FLAG_ACTIVITY_NEW_TASK and FLAG_ACTIVITY_MULTIPLE_TASKS.
And I want to get the info of these new tasks(as well as activities)by using getRunningTasks.
Also I want to set some unique identifiers for these tasks in order to manage them conveniently.
I have tried to use the description, but it can not be modified.Codes are as followed:
ActivityManager am = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> taskInfos = am.getRunningTasks(2);
ActivityManager.RunningTaskInfo currentTaskInfo = taskInfos.get(0);
am.getRunningTasks(2).get(0).description = "dfasdfsa";
Toast.makeText(this,am.getRunningTasks(2).get(0).description, 10).show();
When the Toast shows, the value of description is still null.I seems I can not change it.
Please give me a solution to set a unique identifier for a task.
I really appreciate your help! :)