Why RecyclerView.notifyItemChanged() will create a new ViewHolder and use both the old ViewHolder and new one?
RecyclerView use both of ViewHolder for smooth animation from an old state to a new. This is default behaviour of RecyclerView.ItemAnimator.
You can disable animation by passing an empty item animator to RecyclerView:
listView.setItemAnimator(null);
((SimpleItemAnimator) myRecyclerView.getItemAnimator()).setSupportsChangeAnimations(false);
To avoid ViewHolder's recreating and without disabling smooth animation after call recyclerView.notifyItemChanged() you can set DefaultItemAnimator and override canReuseUpdatedViewHolder() method.
Kotlin:
val itemAnimator: DefaultItemAnimator = object : DefaultItemAnimator() {
override fun canReuseUpdatedViewHolder(viewHolder: RecyclerView.ViewHolder): Boolean {
return true
}
}
recyclerView.itemAnimator = itemAnimator