How to sort RecyclerView item in android

前端 未结 7 1784
暖寄归人
暖寄归人 2021-01-01 11:29

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

相关标签:
7条回答
  • 2021-01-01 12:19
     List<Items_Detail_model>items_model;
      Collections.sort(items_model, new Comparator<Items_Detail_model>() {
                @Override
                public int compare(Items_Detail_model o1, Items_Detail_model o2) {
                    return o1.getDate().compareTo(o2.getDate());
                }
            });
    
    0 讨论(0)
提交回复
热议问题