Using a SimpleAdapter, how can i map images to a ListAdapter Row? using android sdk
- by nathanjosiah
Here is the code that i have for the adapter.
ArrayList<HashMap<String, Object>> mylist = new ArrayList<HashMap<String, Object>>();
for (CustomClass imageObject : myArray) {
HashMap<String, Object> map = new HashMap<String, Object>();
BmpFromURL myBmp = new BmpFromURL(image.getURL());
map.put("image", myBmp.getMyBitmap());
mylist.add(map);
}
SimpleAdapter adapter = new SimpleAdapter(this, mylist, R.layout.series_list_row,
new String[]{"image"},
new int[]{R.id.ImageView01});
this.setListAdapter(adapter);
getMyBitmap() returns a Bitmap.