1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-13 13:05:03 -05:00
k-9/src/com/android/email/mail/MessageDateComparator.java

20 lines
503 B
Java
Raw Normal View History

package com.android.email.mail;
import java.util.Comparator;
public class MessageDateComparator implements Comparator<Message> {
public int compare(Message o1, Message o2) {
try {
if (o1.getSentDate() == null) {
return 1;
} else if (o2.getSentDate() == null) {
return -1;
} else
return o2.getSentDate().compareTo(o1.getSentDate());
} catch (Exception e) {
return 0;
}
}
}