1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| mySimpleAdapter = new SimpleAdapter( MainActivity.this, list, R.layout.musiclist, new String[]{"musicId", "musicName", "musicImage", "musicPath"}, new int[]{R.id.musicId, R.id.musicName, R.id.musicImage, R.id.path});
mySimpleAdapter.setViewBinder(new SimpleAdapter.ViewBinder() { @Override public boolean setViewValue(View view, Object data, String textRepresentation) { if (view instanceof ImageView && data instanceof Bitmap) { ImageView iv = (ImageView) view; iv.setImageBitmap((Bitmap) data); return true; } else return false; } });
|