請大家先看看我的代碼:放ImageView的SRC來的HashMap <String,字符串>
private ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
//...
ImageView temp = new ImageView(MyApp.this);
temp.setImageResource(R.drawable.icon);
//...
HashMap<String, String> map = list.get(i);
map.put("pic", temp.toString()); //"pic" will map to a ImageView
這裏是我的questione:
我知道,
map.put("pic", temp.toString());
是錯誤。
但是什麼是正確的方法。
在此先感謝。
要提取牛逼究竟是什麼這裏?您將無法僅提取「Drawable」的資源引用。 – 2011-03-28 08:15:13
所以,我不能以這種方式設置ImageView? – cht 2011-03-28 08:25:09
我想從服務器設置ImageView並希望它在任務中執行。所以,我需要知道如何更改ImageView。 – cht 2011-03-28 08:26:56