Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hashCode can collide with item ids from data, leading to RecyclerView crash #38

Open
wants to merge 1 commit into
base: master-3.0
Choose a base branch
from

Conversation

mtotschnig
Copy link

If the hashCode for a section is equal to the first itemId of a section, RecyclerView will eventually complain and crash with
java.lang.IllegalStateException: Two different ViewHolders have the same stable ID. Stable IDs in your adapter MUST BE unique and SHOULD NOT change.
This pull requests uses different approach for calculating ids for sections.

@MinceMan
Copy link
Collaborator

Thanks for this. I think that you have a valid use case but this clashes with the stable Id requirement. Let me think about it a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants