开发者

Put images in a hashmap?

Can anyone help me how to put images in a hashmap?

I tried something like this :

HashMap<String, Object> map = new HashMap<String, Object>();
                    String img_1 = "<img src='http://graph.facebook.com/" + friends.get(i).getId()
                            + "/picture?type=small' />";

                    map.put("item", Html.fromHtml(img_1));
                    map.put("friend", friends.get(i).getName());
                    System.out.println("Valoare HashMap este:" + map);
         开发者_运维技巧           mylist.add(map);

but I see only the text, without image.

Please help....


Here: http://developer.android.com/reference/android/text/Html.html in description of public static Spanned fromHtml (String source)
it says:
"Returns displayable styled text from the provided HTML string. Any tags in the HTML will display as a generic replacement image which your program can then go through and replace with real images."
So, you are getting the what you are supposed to get from this method, if you need to get whole images have a look at: Android HTML.fromHTML() with images?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜