How to sort the dates from current to old date in Android or Java?
You can go with Comparator and can sort data by using compare()
Collections.sort(dateList, new Comparator<Date>(){
public int compare(Date date1, Date date2){
return date1.after(date2);
}
});
Try this:
Comparator date_comparator = new Comparator() {
@Override
public int compare(Date date1, Date date2){
return date1.compareTo(date2);
}
};