Inspectopedia Help

RecyclerView Problems

RecyclerView Problems

RecyclerView will not call onBindViewHolder again when the position of the item changes in the data set unless the item itself is invalidated or the new position cannot be determined.

For this reason, you should only use the position parameter while acquiring the related data item inside this method, and should not keep a copy of it.

If you need the position of an item later on (e.g. in a click listener), use getAdapterPosition() which will have the updated adapter position.

Issue id: RecyclerView

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for Android 2023.3, Qodana for JVM 2023.3


Android, 2022.3.1 Beta 2

Last modified: 13 July 2023