I have notifyDataSetChanged()
followed by notifyItemChanged(0, Unit)
with payload called for the same adapter, containing, say, 3 items.
Each of the calls is made inside view.post()
.
I expect onBindViewHolder()
will be called 4 times: 3 times for notifyDataSetChanged()
and one time for notifyItemChanged()
In fact it is called 3 times, all with empty payload.
But if I replace view.post()
on view.postDelayed({notifyItemChanged(0, Unit)}, 1000)
, everithing works like a charm.
Could you explain me, why this happens?