I have an ArrayList of HashMap like this:
ArrayList<HashMap<String, String>> playListSongs = new ArrayList<HashMap<String, String>>();
I populate the list like this:
for (int i1 = 0; i1 < nl.getLength(); i1++) {
// creating new HashMap
HashMap<String, String> map = new HashMap<String, String>();
Element e = (Element) nl.item(i1);
// adding each child node to HashMap key => value
map.put(KEY_SONGS, String.valueOf(i1));
map.put(KEY_FILE, parser.getValue(e, KEY_FILE));
map.put(KEY_DURATION, parser.getValue(e, KEY_DURATION));
map.put(KEY_FILE, parser.getValue(e, KEY_FILE));
map.put(KEY_ALBUM, parser.getValue(e, KEY_ALBUM));
map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE));
map.put(KEY_ARTIST, parser.getValue(e, KEY_ARTIST));
map.put(KEY_ARTWORK, parser.getValue(e, KEY_ARTWORK));
// Songs List of selected playlist
playListSongs.add(map);
// list view bind
PopulateList(playListSongs);
}
Now i want to Get Album and songs of a specific Artist and song count from HashMap-array-list(playListSongs) to bind it to the list view.
How can I achieve this?
You can use this method to get songs of specific artist:
To get distinct artists use following method: