Here you can find a lazy loading library to download images from a URL and show them in a ListView
. Also i suggest you to avoid using 3 different Arraylists
and use only one ArrayList
, instead, with a custom class that is used to store the information of an image(title, date and image url).
EDIT: Here is an example class that holds the information needed for the image:
import java.util.Date;
public class ImageObject {
private String image_name;
private String image_url;
private Date image_date;
public ImageObject() {
}
public ImageObject(String image_name, String image_url, Date image_date) {
this.image_name = image_name;
this.image_url = image_url;
this.image_date = image_date;
}
public void setImageName(String image_name) {
this.image_name = image_name;
}
public void setImageURL(String image_url) {
this.image_url = image_url;
}
public void setImageDate(Date image_date) {
this.image_date = image_date;
}
public String getImageName() {
return this.image_name;
}
public String getImageURL() {
return this.image_url;
}
public Date getImageDate() {
return this.image_date;
}
}
Here is an example usage in witch i initiate a ArrayList
with one ImageObject
:
ArrayList<ImageObject> data = new ArrayList<ImageObject>();
ImageObject obj = new ImageObject("test.jpg", "www.imageurl.com", new Date());
data.add(obj);
And this is how you retrieve a value from a certain ImageObject
object from the ArrayList
:
data.get(0).getImageName();