Commit 54e4a066 authored by Geoffrey Métais's avatar Geoffrey Métais

Browsers: init preferences with correct context

parent cb9cb1b3
...@@ -107,7 +107,7 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd ...@@ -107,7 +107,7 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
protected int mSavedPosition = -1, mFavorites = 0; protected int mSavedPosition = -1, mFavorites = 0;
public boolean mRoot; public boolean mRoot;
protected boolean goBack = false; protected boolean goBack = false;
private final boolean mShowHiddenFiles; private boolean mShowHiddenFiles;
private SimpleArrayMap<MediaLibraryItem, List<MediaLibraryItem>> mFoldersContentLists; private SimpleArrayMap<MediaLibraryItem, List<MediaLibraryItem>> mFoldersContentLists;
public int mCurrentParsedPosition = 0; public int mCurrentParsedPosition = 0;
...@@ -132,14 +132,12 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd ...@@ -132,14 +132,12 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
handlerThread.start(); handlerThread.start();
mBrowserHandler = new Handler(handlerThread.getLooper()); mBrowserHandler = new Handler(handlerThread.getLooper());
} }
mShowHiddenFiles = PreferenceManager.getDefaultSharedPreferences(VLCApplication.getAppContext()).getBoolean("browser_show_hidden_files", false);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void onCreate(Bundle bundle) { public void onCreate(Bundle bundle) {
super.onCreate(bundle); super.onCreate(bundle);
if (bundle == null) if (bundle == null) bundle = getArguments();
bundle = getArguments();
if (bundle != null) { if (bundle != null) {
mCurrentMedia = bundle.getParcelable(KEY_MEDIA); mCurrentMedia = bundle.getParcelable(KEY_MEDIA);
if (mCurrentMedia != null) mMrl = mCurrentMedia.getLocation(); if (mCurrentMedia != null) mMrl = mCurrentMedia.getLocation();
...@@ -149,6 +147,7 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd ...@@ -149,6 +147,7 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
mMrl = getActivity().getIntent().getDataString(); mMrl = getActivity().getIntent().getDataString();
getActivity().setIntent(null); getActivity().setIntent(null);
} }
mShowHiddenFiles = PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean("browser_show_hidden_files", false);
mRoot = defineIsRoot(); mRoot = defineIsRoot();
if (mFoldersContentLists == null) mFoldersContentLists = new SimpleArrayMap<>(); if (mFoldersContentLists == null) mFoldersContentLists = new SimpleArrayMap<>();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment