I\'m working on a android chatting application. When I called my api it returns me the chat list sorted by a user_id. But what I need to do is serialized by
data.sort(new Comparator() {
@Override
public int compare(Datum o1, Datum o2) {
return o1.get(position).getMessageId().compareTo(o2.get(position).getMessageId());
}
});
then pass (notify) the sorted list to the adapter.