i am adding data to ArrayList < HashMap < String, Object>> contactList;
i want to sort the contactList as per their single field .
i am adding data like this :
HashMap<String, Object> docs = new HashMap<>();
docs.put("name", key);
docs.put("speciality", speci);
docs.put("status", status); // sort by this field , if contains online it should appear first .
docs.put("picture", bp);
docs.put("education", educate);
docs.put("experience", experi);
docs.put("rating", ft);
contactList.add(docs);
data is added in a loop and later i assign contactList to simpleAdapter for listview.
Now i want my contact list to compare the 'status' field , if status is 'online' show first or if all status are offline do nothing just show all ;
how can i sort my data , i need to use this data later in listView to show online status contacts first in listview. Any help Would be appreciated. Thanks