我有一张照片Uri和我想要在ListView中显示它,我该怎么做? 这里是我的代码如何在Uri中显示ListView中的图像
Uri img = getImgByContactId(Long id);
map.put("imgcontact", ???? img ??????);
map.put("date", "20/2010");
map.put("duration", String.valueOf(duration));
map.put("type", finalTypeImg);
SimpleAdapter mSchedule = new SimpleAdapter (this.getBaseContext(), listItem, R.layout.calllogtemplate,
new String[] {"num", "name", "imgcontact", "date", "duration", "type"},
new int[] {R.id.num, R.id.name, R.id.imgcontact, R.id.date, R.id.duration, R.id.typecall});
ListView maListViewPerso = (ListView) findViewById(android.R.id.list);
maListViewPerso.setAdapter(mSchedule);
感谢
编写自己的适配器,它扩展了ArrayAdapter,然后在getView()中自己处理图像,并使用你的uri将其设置为imageview。 – Blundell 2012-01-28 00:23:56