[Android] Widget : fix IAE when first load playlist

Alexandre Perraud git at videolan.org
Fri Jun 12 15:26:14 CEST 2015


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Fri Jun 12 15:21:13 2015 +0200| [7cfedaf3cffac1821ab7467a660b7e5934c6f4a9] | committer: Alexandre Perraud

Widget : fix IAE when first load playlist

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=7cfedaf3cffac1821ab7467a660b7e5934c6f4a9
---

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

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 6f9285e..07614de 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1114,6 +1114,8 @@ public class PlaybackService extends Service {
     private synchronized void loadLastPlaylist() {
         SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
         String currentMedia = prefs.getString("current_media", "");
+        if (currentMedia.equals(""))
+            return;
         String[] locations = prefs.getString("media_list", "").split(" ");
 
         List<String> mediaPathList = new ArrayList<String>(locations.length);



More information about the Android mailing list