简体   繁体   中英

Custom arrayadapter for listview with image

So I am following the tutorial here so I can images to my listview. The problem is in this tutorial the images are already installed so for getting the image it is saved as an int like so:

private int imageId;
private String title;
private String desc;

public RowItem(int imageId, String title, String desc) {
    this.imageId = imageId;
    this.title = title;
    this.desc = desc;
}
public int getImageId() {
    return imageId;
}

But I am getting the images from a server where it is coming to the app as a string and then be converted to a bitmap. The question I have is could I just change int to bitmap and everything will work out or is there something else I need to do? I don't want to work all the way through this and then it not work.

Thank you in advance,

Tyler

实际上,您想看看https://github.com/nostra13/Android-Universal-Image-Loaderlazy load图像并对其进行缓存,以防止网络冻结UI线程。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM