I have a Model UniqueUserTransModel
and a UniqueArrayList
. Initially, I have the List and I am passing it to the Adapter.
Old List ->
pos : 0, name : "user 1", transcount : 10
pos : 1, name : "user 2", transcount : 9
pos : 2, name : "user 3", transcount : 8
pos : 3, name : "user 4", transcount : 7
pos : 4, name : "user 5", transcount : 6
After Updating I have a NewList
and I set it to UniqueArrayList = (newly Computed ArrayList).
New List ->
pos : 0, name : "user 2", transcount : 11
pos : 1, name : "user 1", transcount : 9
pos : 2, name : "user 3", transcount : 8
pos : 3, name : "user 4", transcount : 7
pos : 4, name : "user 5", transcount : 6
And I just called notifydatasetChanged
from the Fragment.
The first two items get swapped in the NewList
but are not reflecting in the recyclerview.
Why it is not reflecting? I know if I clear the old list and freshly add the new one it will work or if i add or remove a new Item then also it will work.