What\'s Happening:
The list (RecyclerView)
is mixing up the data when I scroll.
I.E when I scr
use holder.setIsRecyclable(false); in onBindViewHolder of your adapter class
The problem is the CardView
and TextView
objects are declared static inside the FeedViewHolder
. That means that all the calls trying to set the title in the onBindViewHolder
method hit the latest inflated View.
The fix is to remove the static
from cv
, title
, pubDate
, description
, then implement some non static setters like:
public void setTitle(String s) {
title.setText(s);
}
To be called in the onBindViewHolder
method:
@Override
public void onBindViewHolder(RVAdapter.FeedViewHolder holder, int position) {
holder.setTitle(items.get(position).getTitle());
//...
}