public class ActiveAlarm { public long timeStarted; public long timeEnded; private String name = ""; private String description = ""; private String event; private boolean live = false;}List<ActiveAlarm> con = new ArrayList<ActiveAlarm>();Collections.sort(con , (a1, a2) -> a1.timeStarted.compareTo(a2.timeStarted));Collections.sort(con , (a1, a2) -> a1.timeEnded.compareTo(a2.timeEnded));
↧
Answer by Gergana Toncheva for How to sort List of objects by some property
↧