[Solved] Sort ArrayList of Calendars


I believe the the theme is not calendar sorting. If so then do not allocate more memory using Calender object,
add this method simply,

public class ProgramItem {
   ....
   int getAsMins() {
      return hours *60 + mins;
   }
}
....
Collections.sort(items, new Comparator<ProgramItem>() {
        public int compare(ProgramItem item1, ProgramItem item2) {
           return item1.getAsMins() - item2.getAsMins();
        }
});

solved Sort ArrayList of Calendars