Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RecyclerView.clear()? Is there a method to clear() or invalidate a viewholder data individually?

I came across the documentation for AsyncPagedListDiffer. I'm wondering how we can call holder.clear() when holder is a RecyclerView.ViewHolder instance. Maybe they have an in-house method which accommodates this clearance functionality?

like image 354
Guru Karthi R Avatar asked Jan 21 '26 23:01

Guru Karthi R


1 Answers

Yes, in the code sample on that page, UserViewHolder is assumed to be an extension (that you write) of RecyclerView.ViewHolder that implements additional bindTo and clear methods.

like image 190
cybersam Avatar answered Jan 23 '26 13:01

cybersam