I have a list from the Type and I would like to sort this list by an element of date. I googled and I saw some solutions with comparable, but is there a possibility to do this
Collections.sort(Type, new Comparator() {
@Override
public int compare(Type o1, Type o2) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd h:m");
Date d1 = sdf.parse(o1.date);
Date d2 = sdf.parse(o2.date);
return d1.compareTo(d2);
}
});