package com.uservoice.uservoicesdk.image;

import java.io.InputStream;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.widget.ImageView;

public class DownloadImageTask extends AsyncTask<Void, Void, Bitmap> {
    private ImageView imageView;
    private final String url;

    public DownloadImageTask(String url, ImageView imageView) {
        this.url = url;
        this.imageView = imageView;
        imageView.setImageBitmap(null);
    }

    protected Bitmap doInBackground(Void... voids) {
        Bitmap bitmap = null;
        try {
            InputStream in = new java.net.URL(url).openStream();
            bitmap = BitmapFactory.decodeStream(in);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return bitmap;
    }

    protected void onPostExecute(Bitmap bitmap) {
        ImageCache.getInstance().set(url, bitmap);
        imageView.setImageBitmap(bitmap);
    }

}
@@ -600,13 +600,30 @@
     
-try %7B
+InputStream in = null;
 %0A   
@@ -623,39 +623,50 @@
 ll;%0A        
+%0A
     
-InputStream
+    try %7B%0A           
  in = new ja
@@ -809,24 +809,68 @@
 ackTrace();%0A
+        %7D finally %7B%0A            in.close();%0A
         %7D%0A  
@@ -1047,9 +1047,10 @@
 %0A    %7D%0A%0A
-
 %7D
+%0A

Update DownloadImageTask.java