i have sorted the data on the basis of name. but when i am going to sort the data of arraylist of hash map on the basis of "date", i have no idea how to solve it. my Method for sort by name is given below.
protected ArrayList<HashMap<String, String>> setListOrderByName(ArrayList<HashMap<String, String>> menuItems2) {
Collections.sort(menuItems2, new Comparator<HashMap<String, String>>() {
public int compare(HashMap<String, String> mapping1,
HashMap<String, String> mapping2) {
return mapping1.get(KEY_NAME).compareTo(mapping2.get(KEY_NAME));
}
});
return menuItems2;
}
i have receive the data from xml parsing. where we get name, date ,time and etc in string format.