From c73a1aaa90694c66feefc59557b35f5913ef1b04 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Thu, 7 May 2015 11:06:47 -0700 Subject: Call dispatchFinishTemporaryDetach before returning a transient view ListView caches transient state views for reuse during layout, which calls dispatchStartTemporaryDetach() before caching the view. This should always be followed by a corresponding dispatchFinishTemporaryDetach() before removing the view from the cache and returning it for reuse. While this was the case for other types of cached views, we missed this call for views placed in one of the two transient view caches. Bug: 17387206 Change-Id: I840ed1338b1bc623dcb77c8b42d2fb6bf646de2e --- core/java/android/widget/AbsListView.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index c57a53a..c9955e8 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -2351,8 +2351,10 @@ public abstract class AbsListView extends AdapterView implements Te } } - // Scrap view implies temporary detachment. isScrap[0] = true; + + // Finish the temporary detach started in addScrapView(). + transientView.dispatchFinishTemporaryDetach(); return transientView; } @@ -2365,7 +2367,8 @@ public abstract class AbsListView extends AdapterView implements Te } else { isScrap[0] = true; - child.dispatchFinishTemporaryDetach(); + // Finish the temporary detach started in addScrapView(). + transientView.dispatchFinishTemporaryDetach(); } } -- cgit v1.1