summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alan Viverette <alanv@google.com> 2015-05-07 11:06:47 -0700
committer Alan Viverette <alanv@google.com> 2015-05-07 11:06:47 -0700
commitc73a1aaa90694c66feefc59557b35f5913ef1b04 (patch)
tree95fb7598a92a48c643f163ad1ae53d97468fea7f
parent83ce3b26b612d729cb4ec195b88bc070094cda39 (diff)
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
-rw-r--r--core/java/android/widget/AbsListView.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index c57a53a93650..c9955e8ce3cb 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<ListAdapter> 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<ListAdapter> implements Te
} else {
isScrap[0] = true;
- child.dispatchFinishTemporaryDetach();
+ // Finish the temporary detach started in addScrapView().
+ transientView.dispatchFinishTemporaryDetach();
}
}