[Android] Initialize preference object before using it...

Geoffrey Métais git at videolan.org
Wed Jan 6 11:37:04 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jan  6 11:35:39 2016 +0100| [dea96fdede1f9e9923679571a5f08c1f1b156f2f] | committer: Geoffrey Métais

Initialize preference object before using it...

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

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

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index f050a71..093f0a5 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -210,6 +210,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
     public void onCreate() {
         super.onCreate();
 
+        mSettings = PreferenceManager.getDefaultSharedPreferences(this);
         mMediaPlayer = newMediaPlayer();
 
         if (!VLCInstance.testCompatibleCPU(this)) {
@@ -217,7 +218,6 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
             return;
         }
 
-        mSettings = PreferenceManager.getDefaultSharedPreferences(this);
         mDetectHeadset = mSettings.getBoolean("enable_headset_detection", true);
 
         mCurrentIndex = -1;



More information about the Android mailing list