[Android] Persist playback icon on Android 7+

Geoffrey Métais git at videolan.org
Wed Nov 22 18:01:24 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Nov 22 17:23:15 2017 +0100| [b9b26ef29bdc21914baeb55ea37650ab461af885] | committer: Geoffrey Métais

Persist playback icon on Android 7+

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

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

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index d38ddbed4..3722a444d 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -53,6 +53,7 @@ import android.support.annotation.MainThread;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.v4.app.NotificationManagerCompat;
+import android.support.v4.app.ServiceCompat;
 import android.support.v4.content.LocalBroadcastManager;
 import android.support.v4.media.MediaBrowserCompat;
 import android.support.v4.media.MediaBrowserServiceCompat;
@@ -1015,7 +1016,7 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
                                 NotificationManagerCompat.from(ctx).notify(3, notification);
                         } else {
                             if (mIsForeground) {
-                                PlaybackService.this.stopForeground(false);
+                                ServiceCompat.stopForeground(PlaybackService.this, ServiceCompat.STOP_FOREGROUND_DETACH);
                                 mIsForeground = false;
                             }
                             NotificationManagerCompat.from(ctx).notify(3, notification);



More information about the Android mailing list