[Android] Browsers: init preferences with correct context

Geoffrey Métais git at videolan.org
Tue Apr 3 10:19:57 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Apr  3 10:18:56 2018 +0200| [a6d51a87afc46174e2842cd0951ab8cc9758a8ec] | committer: Geoffrey Métais

Browsers: init preferences with correct context

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
index 5ac112efa..0a5eed35b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -132,14 +132,12 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
             handlerThread.start();
             mBrowserHandler = new Handler(handlerThread.getLooper());
         }
-        mShowHiddenFiles = PreferenceManager.getDefaultSharedPreferences(VLCApplication.getAppContext()).getBoolean("browser_show_hidden_files", false);
     }
 
     @SuppressWarnings("unchecked")
     public void onCreate(Bundle bundle) {
         super.onCreate(bundle);
-        if (bundle == null)
-            bundle = getArguments();
+        if (bundle == null) bundle = getArguments();
         if (bundle != null) {
             mCurrentMedia = bundle.getParcelable(KEY_MEDIA);
             if (mCurrentMedia != null) mMrl = mCurrentMedia.getLocation();
@@ -149,6 +147,7 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
             mMrl = getActivity().getIntent().getDataString();
             getActivity().setIntent(null);
         }
+        mShowHiddenFiles = PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean("browser_show_hidden_files", false);
         mRoot = defineIsRoot();
         if (mFoldersContentLists == null) mFoldersContentLists = new SimpleArrayMap<>();
     }



More information about the Android mailing list