Removed old DownloadImageTask class
This commit is contained in:
parent
f9d4d5d165
commit
278329d55f
@ -1,37 +0,0 @@
|
||||
package es.ugr.swad.swadroid.utils;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* Class for download a single image from URL and show it in an ImageView.
|
||||
*/
|
||||
public class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
|
||||
private final 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("DownloadImageTask", e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return mIcon11;
|
||||
}
|
||||
|
||||
protected void onPostExecute(Bitmap result) {
|
||||
bmImage.setImageBitmap(result);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user