try this
you can exeecute it by
new DownloadImageTask((ImageView) im1).execute(url here);
private class DownloadImageTask extends AsyncTask {
ImageView bmImage;
public DownloadImageTask(ImageView bmImage) {
this.bmImage = bmImage;
}
protected Bitmap doInBackground(String... urls) {
String urldisplay = urls[0];
Bitmap mIcon11 = null;
try {
InputStream in = new java.net.URL(urldisplay).openStream();
mIcon11 = BitmapFactory.decodeStream(in);
} catch (Exception e) {
Log.e("Error", e.getMessage());
e.printStackTrace();
}
return mIcon11;
}
/* @Override
protected void onPreExecute() {
// TODO Auto-generated method stub
super.onPreExecute();
showProgressDialog();
}*/
protected void onPostExecute(Bitmap result) {
//pDlg.dismiss();
bmImage.setImageBitmap(result);
}}