I need to implement an application similar to Facebook Messenger. I implemented an endless list which request more users if the list reaches the bottom when scrolling. The problem is the order of the list. It might change between requests. In Facebook Messenger the list of users is ordered with respect to time of conversation. Between app requests I may talk with somebody and the list order on server changes. So the following can occur:
Initial list on server
1 2 3 4 5 6 7 8
Each request downloads 4 users.
First request: 1 2 3 4
Data order changed on server between requests from the app:
5 1 2 3 4 6 7 8
Second Request:
4 6 7 8
The list in android app:
1 2 3 4 4 6 7 8
How to solve this?