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 28d7550f..580c493b 100644 --- a/flexible-adapter/src/main/java/eu/davidea/flexibleadapter/FlexibleAdapter.java +++ b/flexible-adapter/src/main/java/eu/davidea/flexibleadapter/FlexibleAdapter.java @@ -409,13 +409,15 @@ public void updateDataSet(@Nullable List items, boolean animate) { else mItems = new ArrayList<>(items); notifyDataSetChanged(); } - //Check if Data Set is empty - if (mUpdateListener != null && getItemCount() == 0) { - mUpdateListener.onUpdateEmptyView(0); - } else { + //Show headers and expanded items if Data Set not empty + if (getItemCount() > 0) { expandItemsAtStartUp(); if (headersShown) showAllHeaders(); } + //Update empty view + if (mUpdateListener != null) { + mUpdateListener.onUpdateEmptyView(getItemCount()); + } } /**