public class SortChineseName implements Comparator<FriendListAdapter.FriendItem> { Collator cmp = Collator.getInstance(java.util.Locale.CHINA); @Override public int compare(FriendListAdapter.FriendItem o1, FriendListAdapter.FriendItem o2) { if (cmp.compare(o1.friend.getName(), o2.friend.getName())>0){ return 1; }else if (cmp.compare(o1.friend.getName(), o2.friend.getName())<0){ return -1; } return 0; }}
网友评论