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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user