我有一个这样ArrayList
的:HashMap
ArrayList<HashMap<String, String>> playListSongs = new ArrayList<HashMap<String, String>>();
我这样填充列表:
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);
}
现在我想从 HashMap-array-list(playListSongs) 中获取特定艺术家的专辑和歌曲以及歌曲数量,以将其绑定到列表视图。
我怎样才能做到这一点?