diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 20f7cdb87c..f3dec9a814 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -995,10 +995,8 @@ public abstract class RecentsView extends PagedView impl mPendingAnimation = pendingAnimation; mPendingAnimation.addEndListener((onEndListener) -> { if (onEndListener.isSuccess) { - int taskViewCount = getTaskViewCount(); - for (int i = 0; i < taskViewCount; i++) { - removeTask(getTaskViewAt(i).getTask(), -1, onEndListener, false); - } + // Remove all the task views now + ActivityManagerWrapper.getInstance().removeAllRecentTasks(); removeAllViews(); onAllTasksRemoved(); }