After implementing the Hashmap I realized that it was not sorted alphabetically so now I wanted to know if there's another map that sorts the files for me? I tried using the code above but it says that I can't use sort in my listview type
public ArrayList<HashMap<String, String>> songsList =
new ArrayList<HashMap<String, String>>();
Collections.sort(songsList, new Comparator<String>() {
@Override
public int compare(String s1, String s2) {
return s1.compareToIgnoreCase(s2);
}
});
Comparator<String>onHashMap, becauseHashMapis notString. (you need aComparator<HashMap<String, String>>)List<Map<String, String>> songsList = newArrayList<HashMap<String, String>>();