1.I have a problem: RecyclerView showing wrong data when scrolling, I put if- else condition in onBindViewHolder() for showing Description text on Child Item on particular condition, First time when populate list it is showing correct but after scrolling list its showing wrong.
@Override
public void onBindViewHolder(ViewHolder holder, final int position) {
final ContentItem content = values.get(position);
holder.txtName.setText(content.getName());
if( holder.txtDescription.equals("hasDescription"))
{
holder.txtHeader.setText(content.getDescription());
}
}
Thanks in Advance.
looks like you are missing to override some methods. you need to override below methods.
@Override
public long getItemId(int position) {
return position;
}
@Override
public int getItemViewType(int position) {
return position;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With