【发布时间】:2026-01-01 01:35:02
【问题描述】:
我一直在尝试将我的图像 url 加载到一个列表视图中,这是第一个必须下载的列表视图,有人可以帮助我。
HashMap<String, String> map = new HashMap<String, String>();
map.put("id", String.valueOf(i));
map.put("name", "House name:" + json_data.getString("name"));
map.put("address", "Adress: " + json_data.getString("address"));
URL newurl = new URL(json_data.getString("imageUrl"));
itmap bitmap = BitmapFactory.decodeStream((InputStream) new URL(result).getContent());
ImageView imagy = (ImageView)findViewById(R.id.image);
imagy.setImageBitmap(bitmap);
map.put("img",bitmap);//error is here says convert bitmap to type string
mylist.add(map);
【问题讨论】:
-
这个错误有点说明你的问题是什么:你试图把一个
Bitmap对象放入一个HashMap<String, String>对象中。
标签: android json image url listview