ShamylZakariya / StickyHeaders

Adapter and LayoutManager for Android RecyclerView which enables sticky header positioning.
MIT License
1.4k stars 185 forks source link

How to get properly getItemId #24

Open rusmichal opened 8 years ago

rusmichal commented 8 years ago

Hello

I have List object of FeedProvider one feedprovider included List of ViewModels. I want to get hashcode of one viewmodel object.

@Override
    public long getItemId(int position) {
        int sectionPostion = getSectionForAdapterPosition(position);

        int positionItem = getPositionOfItemInSection(sectionPostion, position);
        return feedDataProviders.get(sectionPostion - 1).getTileViewModelList().get(positionItem).hashCode();
    }

But I got IndexOutOfBoundsException. What I am doing wrong?