diff --git a/flexible-adapter/src/main/java/eu/davidea/flexibleadapter/FlexibleAdapter.java b/flexible-adapter/src/main/java/eu/davidea/flexibleadapter/FlexibleAdapter.java index 2577527c..4e5d6542 100644 --- a/flexible-adapter/src/main/java/eu/davidea/flexibleadapter/FlexibleAdapter.java +++ b/flexible-adapter/src/main/java/eu/davidea/flexibleadapter/FlexibleAdapter.java @@ -1628,7 +1628,7 @@ private void showAllHeadersWithReset(boolean init) { T item = getItem(position); // Reset hidden status! Necessary after the filter and the update IHeader header = getHeaderOf(item); - if (header != sameHeader && header != null && !isExpandable((T) header)) { + if (!header.equals(sameHeader) && header != null && !isExpandable((T) header)) { sameHeader = header; header.setHidden(true); } @@ -4220,7 +4220,7 @@ private void resetFilterFlags(List items) { // Restore headers visibility if (headersShown) { IHeader header = getHeaderOf(item); - if (header != sameHeader && header != null && !isExpandable((T) header)) { + if (!header.equals(sameHeader) && header != null && !isExpandable((T) header)) { header.setHidden(false); sameHeader = header; items.add(i, (T) header); @@ -5503,7 +5503,7 @@ private void prepareItemsForUpdate(List newItems) { headersShown = true; } IHeader header = getHeaderOf(item); - if (header != sameHeader && header != null && !isExpandable((T) header)) { + if (header.equals(sameHeader) && header != null && !isExpandable((T) header)) { header.setHidden(false); sameHeader = header; newItems.add(position, (T) header);