@Override public void characters(char[] ch, int start, int length) throws SAXException { // TODO Auto-generated method stub String temp = new String(ch, start, length); if (tagName.equals("id")) { mp3Info.setId(temp); } else if (tagName.equals("mp3.name")) { mp3Info.setMp3Name(temp); } else if (tagName.equals("mp3.size")) { mp3Info.setMp3Size(temp); } else if (tagName.equals("lrc.name")) { mp3Info.setLrcName(temp); } else if (tagName.equals("lrc.size")) { mp3Info.setLrcSize(temp); } }
private SimpleAdapter buildSimpleAdapter(List<Mp3Info> mp3Infos) { List<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>(); for (Iterator iterator = mp3Infos.iterator(); iterator.hasNext(); ) { Mp3Info mp3Info = (Mp3Info) iterator.next(); HashMap<String, String> map = new HashMap<String, String>(); map.put("mp3_name", mp3Info.getMp3Name()); map.put("mp3_size", mp3Info.getMp3Size()); list.add(map); } SimpleAdapter simpleAdapter = new SimpleAdapter( this, list, R.layout.mp3info_item, new String[] {"mp3_name", "mp3_size"}, new int[] {R.id.mp3_name, R.id.mp3_size}); return simpleAdapter; }