aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFenny Fatal <Fenny@Fennyfatal.com>2013-07-21 21:20:16 -0600
committerFenny Fatal <Fenny@Fennyfatal.com>2013-07-21 21:20:16 -0600
commit392b54035b8e6cbd780a7e1b67f9cf4baa3b5302 (patch)
treef7f2025364175318f836242be3f1045ab168e874
parent117ad219919c50a13d1ff558c5e5c27ad55f405a (diff)
downloaddsub-392b54035b8e6cbd780a7e1b67f9cf4baa3b5302.tar.gz
dsub-392b54035b8e6cbd780a7e1b67f9cf4baa3b5302.tar.bz2
dsub-392b54035b8e6cbd780a7e1b67f9cf4baa3b5302.zip
Bandaid Fix so we don't crash on android 4.3.
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java28
1 files changed, 17 insertions, 11 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java b/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java
index f84116f7..782d74d6 100644
--- a/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java
+++ b/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java
@@ -183,17 +183,23 @@ public class ImageLoader implements Runnable {
}
}
}
-
- private void setImage(RemoteControlClient remoteControl, Drawable drawable) {
- if(remoteControl != null && drawable != null) {
- Bitmap origBitmap = ((BitmapDrawable)drawable).getBitmap();
- remoteControl.editMetadata(false)
- .putBitmap(
- RemoteControlClient.MetadataEditor.BITMAP_KEY_ARTWORK,
- origBitmap)
- .apply();
- }
- }
+
+ private void setImage(RemoteControlClient remoteControl, Drawable drawable) {
+ if(remoteControl != null && drawable != null) {
+ Bitmap origBitmap = ((BitmapDrawable)drawable).getBitmap();
+ if ( origBitmap != null && !origBitmap.isRecycled()) {
+ remoteControl.editMetadata(false)
+ .putBitmap(
+ RemoteControlClient.MetadataEditor.BITMAP_KEY_ARTWORK,
+ origBitmap)
+ .apply();
+ } else {
+ remoteControl.editMetadata(true)
+ .putBitmap(RemoteControlClient.MetadataEditor.BITMAP_KEY_ARTWORK, null)
+ .apply();
+ }
+ }
+ }
private void setUnknownImage(View view, boolean large) {
if (large) {