diff options
author | daneren2005 <daneren2005@gmail.com> | 2013-02-19 15:03:31 -0800 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2013-02-19 15:03:31 -0800 |
commit | c30a37550b0732076935ffa658490b77efa65035 (patch) | |
tree | b505bdd0f708177be0719919444deccfb874c515 | |
parent | e4ce03c6f1c3fb5ec48fcefbf814d83a1d5090f4 (diff) | |
download | dsub-c30a37550b0732076935ffa658490b77efa65035.tar.gz dsub-c30a37550b0732076935ffa658490b77efa65035.tar.bz2 dsub-c30a37550b0732076935ffa658490b77efa65035.zip |
Fix TransitionDrawable stack overflow error
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java b/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java index 35e24039..133f2c26 100644 --- a/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java +++ b/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java @@ -158,6 +158,15 @@ public class ImageLoader implements Runnable { emptyImage = Bitmap.createBitmap(imageSizeDefault, imageSizeDefault, Bitmap.Config.ARGB_8888); } existingDrawable = new BitmapDrawable(emptyImage); + } else { + // Try to get rid of old transitions + try { + TransitionDrawable tmp = (TransitionDrawable) existingDrawable; + int layers = tmp.getNumberOfLayers(); + existingDrawable = tmp.getDrawable(layers - 1;) + } catch(Exception e) { + // Do nothing, just means that the drawable is a flat image + } } Drawable[] layers = new Drawable[]{existingDrawable, drawable}; |