diff --git a/ignition-support/ignition-support-lib/src/main/java/com/github/ignition/support/images/remote/RemoteImageLoader.java b/ignition-support/ignition-support-lib/src/main/java/com/github/ignition/support/images/remote/RemoteImageLoader.java index 82a4cdc..4152477 100755 --- a/ignition-support/ignition-support-lib/src/main/java/com/github/ignition/support/images/remote/RemoteImageLoader.java +++ b/ignition-support/ignition-support-lib/src/main/java/com/github/ignition/support/images/remote/RemoteImageLoader.java @@ -331,4 +331,10 @@ public void loadImage(Drawable dummyDrawable, RemoteImageLoaderHandler handler) numRetries, defaultBufferSize)); } } + + public void destroy() { + Log.i("", "shutting down remote image loader"); + executor.shutdownNow(); + } + } diff --git a/ignition-support/ignition-support-lib/src/main/java/com/github/ignition/support/images/remote/RemoteImageLoaderJob.java b/ignition-support/ignition-support-lib/src/main/java/com/github/ignition/support/images/remote/RemoteImageLoaderJob.java index 733993c..150c3e3 100644 --- a/ignition-support/ignition-support-lib/src/main/java/com/github/ignition/support/images/remote/RemoteImageLoaderJob.java +++ b/ignition-support/ignition-support-lib/src/main/java/com/github/ignition/support/images/remote/RemoteImageLoaderJob.java @@ -74,6 +74,12 @@ protected Bitmap downloadImage() { return BitmapFactory.decodeByteArray(imageData, 0, imageData.length); + + } catch (OutOfMemoryError e) { + // do not retry, would make it worse + Log.w(LOG_TAG, "download for " + imageUrl + " failed (attempt " + timesTried + ")"); + return null; + } catch (Throwable e) { Log.w(LOG_TAG, "download for " + imageUrl + " failed (attempt " + timesTried + ")"); e.printStackTrace(); diff --git a/ignition-support/ignition-support-samples/.settings/org.eclipse.core.resources.prefs b/ignition-support/ignition-support-samples/.settings/org.eclipse.core.resources.prefs index 3feb85b..7a53139 100644 --- a/ignition-support/ignition-support-samples/.settings/org.eclipse.core.resources.prefs +++ b/ignition-support/ignition-support-samples/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,3 @@ -#Fri Apr 20 11:08:26 CEST 2012 eclipse.preferences.version=1 encoding/=UTF-8 encoding/src=UTF-8