0

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

1 Answer 1

1

Actually you want to take a look at https://github.com/nostra13/Android-Universal-Image-Loader to lazy load your images and caching them to prevent the network freeze your UI thread.

Sign up to request clarification or add additional context in comments.

2 Comments

But would it still work if I just changed it to int to bitmap. I already know the app should always get the image as a string and I'm not sure how I would implement the image loader you posted.
nope it will not work as that easy. To see an example you can follow sunil-android.blogspot.it/2013/09/… I just googled for: listview universal image loader tutorial

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.