[Android] Set settings instance in case it's not ready

Geoffrey Métais git at videolan.org
Tue Feb 6 13:37:30 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb  6 13:03:16 2018 +0100| [da3ea12c126b41cab100aa23a9aa7ea440a64cfc] | committer: Geoffrey Métais

Set settings instance in case it's not ready

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

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

diff --git a/vlc-android/src/org/videolan/vlc/VLCApplication.java b/vlc-android/src/org/videolan/vlc/VLCApplication.java
index bf690f75d..004fed61b 100644
--- a/vlc-android/src/org/videolan/vlc/VLCApplication.java
+++ b/vlc-android/src/org/videolan/vlc/VLCApplication.java
@@ -23,11 +23,9 @@ import android.app.Activity;
 import android.app.Application;
 import android.content.Context;
 import android.content.Intent;
-import android.content.IntentFilter;
 import android.content.SharedPreferences;
 import android.content.res.Configuration;
 import android.content.res.Resources;
-import android.net.ConnectivityManager;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
@@ -246,7 +244,8 @@ public class VLCApplication extends Application {
         return Medialibrary.getInstance();
     }
 
-    public static void setLocale(){
+    public static void setLocale() {
+        if (sSettings == null) PreferenceManager.getDefaultSharedPreferences(instance);
         // Are we using advanced debugging - locale?
         String p = sSettings.getString("set_locale", "");
         if (!p.equals("")) {



More information about the Android mailing list