The process of understanding Task and backstack
1. graphs obtained from demo test:
1. There can be more than one app activity in a task,
Because an app can correspond to one or more process,
2. So a task can also correspond to multiple process.
2. graphs obtained by the ADB shell Dumpsys activity test:
1.Android maintains all of the tasks in the main stack,
2. Each task is uniquely identified by TaskID, and the activity within the same task is included in the Hist.
3. Different process (with different PID) can contain different activity of the same app,
4. A package identifies a application.
3. graphs obtained through the learning Source:
1. In Activitymanagerservice, the fallback stack is maintained by a Activitystack object, and in Activitystack, the fallback stack is maintained by Mhistory (a ArrayList, not a stack).
2. Each task is a Taskrecord object,
3.TaskRecord does not maintain a stack or list of its own for each task,
4.mHistory, instead of managing the activity directly, maintain the Activityrecord object,
A 5.ActivityRecord object is associated with a task to which it belongs by Taskrecord.
A 6.ActivityRecord object is associated with a corresponding activity through the activity Info object.
7. Analyze the Code of Movetasktofrontlocked () and other tasks in activitystack, resulting in the activityrecord of the same task being put together in Mhistory (in first in, first out order). When a task is transferred to the foreground, the activityrecord belonging to the same task (TaskID consistent) is moved together to the top of the mhistory (in this ArrayList, the last element is in the position of top, mhistory. Top=size ()-1);
"Goose Plant cultivation Diary 0.3" task and Backstack