开发者

HashMap<String,String> temp = new HashMap<String,String>(); for pass image

for(int i=0;i<StoreparsrData.title.size();i++){
 开发者_如何转开发       HashMap<String,String> temp = new HashMap<String,String>();
        Bitmap bt=Utility.getBitmapFile(StoreparsrData.url.get(i).toString());
         ImageView img=(ImageView)findviewbyid(R.id.img);
        img.setImageBitmap(bt);

but iwant to convert this img.setImageBitmap(bt); to string so its input for

temp.put("image",image );




    temp.put("title",StoreparsrData.title.get(i).toString());
    temp.put("description", StoreparsrData.description.get(i).toString());
    temp.put("lastbuilddate", StoreparsrData.lastBuildDate.get(0).toString());
    list.add(temp);
    }

so its show image Pls Reply me


If I'm understanding your question, why not use:

temp.put("image",StoreparsrData.url.get(i).toString());

Then perform the ImageView lookup when you read from the list

EDIT

Here's another approach:

public class ParseBean {
    private ImageView image;
    private String title;
    private String description;
    private String lastBuildDate;
    // add getters and setters here
}
...
for(int i=0;i<StoreparsrData.title.size();i++){
    HashMap<String,ParseBean> temp = new HashMap<String,ParseBean>();
    Bitmap bt=Utility.getBitmapFile(StoreparsrData.url.get(i).toString());
    ImageView img=(ImageView)findviewbyid(R.id.img);
    img.setImageBitmap(bt);
    ParseBean bean = new ParseBean();
    bean.setImage(img);
    bean.setTitle(StoreparsrData.title.get(i).toString());
    bean.setDescription(StoreparsrData.description.get(i).toString());
    bean.setLastBuildDate(StoreparsrData.lastBuildDate.get(0).toString());
    list.add(bean);
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜