System.identityHashCode(r),
r.task.taskId, r.shortComponentName, reason);
r.task.numActivities--;
- if (r.frontOfTask && index < (mHistory.size()-1)) {
+ if (index < (mHistory.size()-1)) {
HistoryRecord next = (HistoryRecord)mHistory.get(index+1);
if (next.task == r.task) {
- next.frontOfTask = true;
+ if (r.frontOfTask) {
+ // The next activity is now the front of the task.
+ next.frontOfTask = true;
+ }
+ if ((r.intent.getFlags()&Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET) != 0) {
+ // If the caller asked that this activity (and all above it)
+ // be cleared when the task is reset, don't lose that information,
+ // but propagate it up to the next activity.
+ next.intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+ }
}
}