Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions kegtab/src/main/java/org/kegbot/app/util/Downloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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

import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
Expand Down Expand Up @@ -57,6 +58,7 @@ public static Bitmap downloadBitmap(String url) {
try {
response = client.newCall(request).execute();
} catch (IOException e) {
Log.e(LOG_TAG, "Error fetching " + url, e);
return null;
}

Expand All @@ -66,8 +68,11 @@ public static Bitmap downloadBitmap(String url) {
try {
bitmap = BitmapFactory.decodeStream(response.body().byteStream(), null, options);
} catch (Exception e) {
Log.e(LOG_TAG, "Error decoding bitmap for " + url, e);
return null;
}
} else {
Log.e(LOG_TAG, "Error fetching " + url + " status=" + response.code());
}

return bitmap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class ImageDownloader {

private static final int HANDLER_KEY_DOWNLOAD_COMPLETE = 1;

private static final boolean DEBUG = false;
private static final boolean DEBUG = true;

/**
* All ImageViews and the URL they have requested.
Expand Down