[Android] Fix current playlist saving

Geoffrey Métais git at videolan.org
Mon Jan 15 17:17:14 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jan 15 16:51:43 2018 +0100| [9970c1d3dec0471e38b0d4b73a8bd52d4abda14b] | committer: Geoffrey Métais

Fix current playlist saving

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

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

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 5d34608b6..3c80a19a6 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1686,11 +1686,9 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
     }
 
     private synchronized void saveMediaList() {
-        if (getCurrentMedia() == null)
-            return;
+        if (getCurrentMedia() == null) return;
         final StringBuilder locations = new StringBuilder();
-        for (int i = 0; i < mMediaList.size(); i++)
-            locations.append(" ").append(Uri.encode(mMediaList.getMRL(i)));
+        for (MediaWrapper mw : mMediaList.getAll()) locations.append(" ").append(mw.getUri().toString());
         //We save a concatenated String because putStringSet is APIv11.
         mSettings.edit()
                 .putString(canSwitchToVideo() || !mMediaList.isAudioList() ? "media_list" : "audio_list", locations.toString().trim())



More information about the Android mailing list