List排序
按照时间元素排序
按照时间元素排序
private List
<NumberBindInfo
> list
;
Collections
.sort(list
, new Comparator<NumberBindInfo
>() {
@Override
public int
compare(NumberBindInfo o1
, NumberBindInfo o2
) {
if (TextUtils
.isEmpty(o1
.getSubts()) || TextUtils
.isEmpty(o2
.getSubts())){
return 2;
}
if (o1
.getSubts().compareTo(o2
.getSubts()) > 0) {
return -1;
} else if (o1
.getSubts().compareTo(o2
.getSubts()) < 0) {
return 1;
} else {
return 0;
}
转载请注明原文地址:https://ipadbbs.8miu.com/read-52629.html