Fixing Recents crash when resetting focus of TaskView already returned to the pool.

Change-Id: Iee789e4e726d5f035ec518f4fec444afecc2bbf2
This commit is contained in:
Winson Chung
2014-11-06 17:07:52 -08:00
parent a11bb74271
commit 7ae4b7e196

View File

@@ -156,6 +156,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
/** Resets this TaskStackView for reuse. */
void reset() {
// Reset the focused task
resetFocusedTask();
// Return all the views to the pool
int childCount = getChildCount();
for (int i = childCount - 1; i >= 0; i--) {
@@ -175,7 +178,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
// Reset the stack state
resetFocusedTask();
mStackViewsDirty = true;
mStackViewsClipDirty = true;
mAwaitingFirstLayout = true;