List do sorting

Collections.sort(newList,new Comparator<FolderEntity>(){
   public int compare(FolderEntity f1,FolderEntity f2){
        return f1.getFolderSetting().getNewOrder() - f2.getFolderSetting().getNewOrder();
}});


newOrder is my reset order.
newList as below:
List <FolderEntity> newList = new ArrayList<FolderEntity>();

你可能感兴趣的:(java)