How to sort ArrayList while implementing Parcelable

后端 未结 2 1020
轮回少年
轮回少年 2021-01-28 05:59

I am trying to sort the category arraylist with Collections.sort method but have no luck with it.

Here is my code:

public class Categories i         


        
2条回答
  •  悲哀的现实
    2021-01-28 06:08

    Collections.sort(yourListHere,new Comparator() {
                @Override
                public int compare(Categories lhs, Categories rhs) {
                    //your sort logic here
                    return 0;
                }
    });
    

    Hope this helps.

提交回复
热议问题