해시 맵 배열이 있습니다. XML 파일에서 정보를 입력하고 있습니다. 내 listview에서 이미지를 다운로드하려면 어떻게해야합니까? hmdata 이후 배열에 추가 할 수있는, 내가 이미지를 얻는 방법을 시도For 루프에서 Hashmap Array에 URL의 이미지를 다운로드 할 수 있습니까?
public void dealsCb(String url, XmlDom xml, AjaxStatus status) {
List<XmlDom> products = xml.tags("Product");
List<HashMap<String, String>> titles = new ArrayList<HashMap<String, String>>();
for (XmlDom product : products) {
HashMap<String, String> hmdata = new HashMap<String, String>();
hmdata.put("title", product.text("Product_Name"));
hmdata.put("desc", product.text("Sale_Price"));
//NEED TO DOWNLOAD IMAGE FROM THIS URL AND THEN ADD TO ARRAY....
hmdata.put("thumb", product.text("Image_URL"));
titles.add(hmdata);
}
String[] from = { "thumb", "title", "desc" };
int[] to = { R.id.icon, R.id.title, R.id.desc };
SimpleAdapter adapter = new SimpleAdapter(getBaseContext(), titles,
R.layout.activity_deals_item, from, to);
ListView listView = (ListView) findViewById(R.id.list);
listView.setAdapter(adapter);
}
는 비트 맵, 다음 드로어 블로 변환 만들지 만입니다 : 여기
내 코드입니다 .put은 문자열을 취합니다 ... 이미지 로딩에 무엇이 없습니까?
덕분에, 나는 그것이 갈주지! 나는 또한 코드를 주셔서 감사합니다 :) – jasonflaherty