From 4b93a9d9bcb7eba1bd0a61611c4fe040a7fe9cec Mon Sep 17 00:00:00 2001 From: Michael Totschnig Date: Wed, 15 Jun 2016 11:06:03 +0200 Subject: [PATCH] hashCode can collide with item ids from data, leading to RecyclerView crash --- .../adapter/datahandler/SectionDataWrapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/main/java/com/twotoasters/sectioncursoradapter/adapter/datahandler/SectionDataWrapper.java b/library/src/main/java/com/twotoasters/sectioncursoradapter/adapter/datahandler/SectionDataWrapper.java index eefde5f..c8fef37 100644 --- a/library/src/main/java/com/twotoasters/sectioncursoradapter/adapter/datahandler/SectionDataWrapper.java +++ b/library/src/main/java/com/twotoasters/sectioncursoradapter/adapter/datahandler/SectionDataWrapper.java @@ -105,7 +105,7 @@ public long getItemId(int listPosition) { int wrappedPosition = getWrappedPosition(listPosition); return wrappedPosition == RecyclerView.NO_POSITION - ? getSectionFromListPosition(listPosition).hashCode() + ? Integer.MAX_VALUE - listPosition : super.getItemId(wrappedPosition); }