[Android] notification: keep default cover if there is none
Sébastien Toque
git at videolan.org
Fri May 3 09:32:50 CEST 2013
vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Fri May 3 09:32:36 2013 +0200| [854e80665f39a87601c8a6eb08f8ed8640257441] | committer: Sébastien Toque
notification: keep default cover if there is none
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=854e80665f39a87601c8a6eb08f8ed8640257441
---
vlc-android/src/org/videolan/vlc/AudioService.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index cdae2c1..1643e43 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -519,7 +519,8 @@ public class AudioService extends Service {
PendingIntent piStop = PendingIntent.getBroadcast(this, 0, iStop, PendingIntent.FLAG_UPDATE_CURRENT);
RemoteViews view = new RemoteViews(getPackageName(), R.layout.notification);
- view.setImageViewBitmap(R.id.cover, cover);
+ if (cover != null)
+ view.setImageViewBitmap(R.id.cover, cover);
view.setTextViewText(R.id.songName, title);
view.setTextViewText(R.id.artist, artist);
view.setImageViewResource(R.id.play_pause, mLibVLC.isPlaying() ? R.drawable.ic_pause : R.drawable.ic_play);
@@ -529,7 +530,8 @@ public class AudioService extends Service {
view.setOnClickPendingIntent(R.id.content, pendingIntent);
RemoteViews view_expanded = new RemoteViews(getPackageName(), R.layout.notification_expanded);
- view_expanded.setImageViewBitmap(R.id.cover, cover);
+ if (cover != null)
+ view_expanded.setImageViewBitmap(R.id.cover, cover);
view_expanded.setTextViewText(R.id.songName, title);
view_expanded.setTextViewText(R.id.artist, artist);
view_expanded.setTextViewText(R.id.album, album);
More information about the Android
mailing list