I am getting image from an url. I am using imageview in listview. I want to add the list of bitmap images into the each row of the list item. I used SimpleAdapter but the im
The best way to do it is to create a class that extends BaseAdapter and then instanciate an async task for every image (on post execute set the bitmap to the correpondent imageView). Here's a simple function to download an image from web:
private Bitmap loadImageFromNetwork(String url) throws MalformedURLException, IOException {
HttpURLConnection conn = (HttpURLConnection) (new URL(url)).openConnection();
conn.connect();
return BitmapFactory.decodeStream(new FlushedInputStream(conn.getInputStream()));
}