Using a SimpleAdapter, how can i map images to a ListAdapter Row? using android sdk

Posted by nathanjosiah on Stack Overflow See other posts from Stack Overflow or by nathanjosiah
Published on 2010-06-15T20:37:31Z Indexed on 2010/06/15 21:02 UTC
Read the original article Hit count: 1065

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about android

Related posts about SDK