Collections.sort(list, comparator);
ActAdapter adp = new ActAdapter(getParent(), list);
lv.setAdapter(adp);
adp.notifyDataSetChanged();
Change Order of map1 and map2 as per your requirement
Comparator<HashMap<String, String>> comparator = new Comparator<HashMap<String, String>>() {
@Override
public int compare(HashMap<String, String> map1, HashMap<String, String> map2) {
return map2.get(CREATED).compareTo(map1.get(CREATED));
}
};
No comments:
Post a Comment