aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/network/HtmlImage.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/network/HtmlImage.java')
-rw-r--r--main/src/cgeo/geocaching/network/HtmlImage.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/network/HtmlImage.java b/main/src/cgeo/geocaching/network/HtmlImage.java
index 6c869c2..ca9aa05 100644
--- a/main/src/cgeo/geocaching/network/HtmlImage.java
+++ b/main/src/cgeo/geocaching/network/HtmlImage.java
@@ -70,7 +70,7 @@ public class HtmlImage implements Html.ImageGetter {
public BitmapDrawable getDrawable(final String url) {
// Reject empty and counter images URL
if (StringUtils.isBlank(url) || isCounter(url)) {
- return null;
+ return new BitmapDrawable(getTransparent1x1Image());
}
Bitmap imagePre = null;
@@ -116,7 +116,7 @@ public class HtmlImage implements Html.ImageGetter {
if (returnErrorImage) {
imagePre = BitmapFactory.decodeResource(context.getResources(), R.drawable.image_not_loaded);
} else {
- imagePre = BitmapFactory.decodeResource(context.getResources(), R.drawable.image_no_placement);
+ imagePre = getTransparent1x1Image();
}
}
@@ -148,6 +148,10 @@ public class HtmlImage implements Html.ImageGetter {
return image;
}
+ private Bitmap getTransparent1x1Image() {
+ return BitmapFactory.decodeResource(context.getResources(), R.drawable.image_no_placement);
+ }
+
private Bitmap loadImageFromStorage(final String url) {
try {
final File file = LocalStorage.getStorageFile(geocode, url, true, false);