[Android] Check cover bitmap for notification isn't recycled

Geoffrey Métais git at videolan.org
Wed Jul 19 14:10:02 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jul 19 11:28:56 2017 +0200| [54f42dd7170663631e230c2a2af4e50b51f0b281] | committer: Geoffrey Métais

Check cover bitmap for notification isn't recycled

> https://code.videolan.org/videolan/vlc-android/commit/54f42dd7170663631e230c2a2af4e50b51f0b281
---

 vlc-android/src/org/videolan/vlc/PlaybackService.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index e2fd081f2..39d868846 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -895,8 +895,8 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
                                     metaData.getBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART) :
                                     AudioUtil.readCoverBitmap(Uri.decode(mw.getArtworkMrl()), width);
                         }
-                            if (cover == null)
-                                cover = BitmapFactory.decodeResource(VLCApplication.getAppContext().getResources(), R.drawable.ic_no_media);
+                            if (cover == null || cover.isRecycled())
+                                cover = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.ic_no_media);
 
                             boolean video = mw.hasFlag(MediaWrapper.MEDIA_FORCE_AUDIO);
                             // add notification to status bar



More information about the Android mailing list