Skip to content Skip to sidebar Skip to footer

Firebase Recycleradapter Displaying Wrong Information Android

My app uses a firebase RecyclerAdapter to display 'plant' entities in an activity. I made it so that if I longclick on an entity displayed in Cardview format using a ViewHolder and

Solution 1:

The position and model are final on the onBindViewHolder method

The viewholder can be final, but not the data or the position

Use holder.getAdapterPosition() to get the position inside annonymous interfaces like click listeners

And then get the data using getItem() method from the adapter class

Post a Comment for "Firebase Recycleradapter Displaying Wrong Information Android"