@Override
    public void onAdapterChanged(RecyclerView.Adapter oldAdapter, RecyclerView.Adapter newAdapter) {
        super.onAdapterChanged(oldAdapter, newAdapter);

        try {
            adapter = (SectioningAdapter) newAdapter;
        } catch (ClassCastException e) {
            throw new ClassCastException("StickyHeaderLayoutManager must be used with a RecyclerView where the adapter is a kind of SectioningAdapter");
        }

        removeAllViews();
        headerViews.clear();
        headerPositionsBySection.clear();
    }
Assign callback object to be notified when a header view position changes between states of the HeaderPosition enum

@param headerPositionChangedCallback the callback
@see HeaderPosition
android/modules/module_common/src/main/java/github/tornaco/android/thanos/widget/section/StickyHeaderLayoutManager.java