My question is how to update item in PagedList?
In my case, there are ListActivity and DetailsActivity. List activity is using Paging component to get posts from network
PagedListAdapter
uses a DiffUtil.ItemCallback
that will only update an existing item if the it considers it a "new" item. It seems to me that you do need to go to the server in order to get the new view count, but also you do not want unaffected items to redraw. This can be prevented by adding the view count property to the DiffUtil.ItemCallback
to determine what a new item is. Items with a new view count will be redrawn, others won't.
I am assuming that the original request that retrieves the first list returns objects that have a viewsCount
field in them.