I can load one image from mysql databse using Async Task, but now i want to load 5 images and show them in a list view so i want first to know how to make doInbackground method return a list of images got from mysql databse :
@Override
protected Bitmap doInBackground(String... params) {
String id = params[0];
String add = "http://192.168.1.11/save/load_image_from_db.php?id=" + id;
URL url;
Bitmap image = null;
try {
final BitmapFactory.Options options = new BitmapFactory.Options();
//options.inJustDecodeBounds = true;
//options.inSampleSize = 4;
//options.inJustDecodeBounds = false;
url = new URL(add);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
image = BitmapFactory.decodeStream(connection.getInputStream(),null,options);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return image;
}