So I have an activity with RecyclerView
and I want to change TextView
of every item in the RecyclerView
by pressing button that has
I would definitely call notifyDataSetChanged()
if all of the data items ar no longer valid. When you call notifyItemChanged(mPos)
, it is equivalent to a call to notifyItemRangeChanged(mPos, 1)
, and every time it is called, requestLayout()
is also called. On the other hand, when you call notifyDataSetChanged()
or notifyItemRangeChanged(0, mList.size())
, there is only one call to requestLayout()
.
Your question should now be, what is better, a call to notifyDataSetChanged()
or notifyItemRangeChanged(0, mList.size())
? For that one I don't have an answer.