package org.example.proyecto;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.util.Log;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;

/**
 * Created by Victor on 11/09/2016.
 */
public class TareaImg extends AsyncTask<String,Void,Bitmap> {

    static InputStream is = null;
    static byte[] result = null;

    byte[] buffer;
    ByteArrayOutputStream baos;


    @Override protected Bitmap doInBackground(String... params) {

        String urldisplay = params[0];
        Bitmap mIcon = null;
        try {
            InputStream in = new java.net.URL(urldisplay).openStream();
            mIcon = BitmapFactory.decodeStream(in);
        } catch (Exception e) {
            Log.e("Error", e.getMessage());
            e.printStackTrace();
        }
        return mIcon;

    }


    @Override protected void onPreExecute() {

    }


    @Override protected void onProgressUpdate(Void... prog) {

    }

}
