diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/widget/ListView.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index 1daee4e..66c162e 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -460,10 +460,30 @@ public class ListView extends AbsListView { */ @Override void resetList() { + // The parent's resetList() will remove all views from the layout so we need to + // cleanup the state of our footers and headers + clearRecycledState(mHeaderViewInfos); + clearRecycledState(mFooterViewInfos); + super.resetList(); + mLayoutMode = LAYOUT_NORMAL; } + private void clearRecycledState(ArrayList<FixedViewInfo> infos) { + if (infos != null) { + final int count = infos.size(); + + for (int i = 0; i < count; i++) { + final View child = infos.get(i).view; + final LayoutParams p = (LayoutParams) child.getLayoutParams(); + if (p != null) { + p.recycledHeaderFooter = false; + } + } + } + } + /** * @return Whether the list needs to show the top fading edge */ |