my code:
Result:
why not can show HTML Image ?
This a way can:
Result:
why this mode can's ?

ImageGetter Code:
Code:
String img_1 = "<img src='http://l.yimg.com/f/i/tw/monday/hp/110616_18.jpg' />";
String img_2 = "<img src='http://l.yimg.com/f/i/tw/monday/hp/110616_17.jpg' />";
ArrayList<HashMap<String,Object>> ListItem = new ArrayList<HashMap<String,Object>>();
HashMap<String,Object> oHash;
oHash= new HashMap<String, Object>();
oHash.put("item", Html.fromHtml(img_1,ig,null));
ListItem.add(oHash);
oHash = new HashMap<String,Object>();
oHash.put("item", Html.fromHtml(img_2,ig,null));
ListItem.add(oHash);
SimpleAdapter adapter = new SimpleAdapter(this,
ListItem,
R.layout.main_menu_row,
new String[]{"item"},
new int[]{R.id.main_menu_textview});
lv.setAdapter(adapter);
Result:
why not can show HTML Image ?
This a way can:
Code:
String img_1 = "<img src='http://l.yimg.com/f/i/tw/monday/hp/110616_18.jpg' />";
String img_2 = "<img src='http://l.yimg.com/f/i/tw/monday/hp/110616_17.jpg' />";
Object[] img = new Object[]{Html.fromHtml(img_1,ig,null),Html.fromHtml(img_2,ig,null)};
lv.setAdapter(new ArrayAdapter<Object>(this, R.layout.main_menu_row, R.id.main_menu_textview, img));
Result:
why this mode can's ?

ImageGetter Code:
Code:
ImageGetter ig = new ImageGetter(){
public Drawable getDrawable(String source) {
try{
Drawable d = Drawable.createFromStream(new URL(source).openStream(), "src name");
d.setBounds(0, 0, d.getIntrinsicWidth(),d.getIntrinsicHeight());
return d;
}catch(IOException e){
Log.v("IOException",e.getMessage());
return null;
}
}
};
