[Android] Use view context to get preferences

Geoffrey Métais git at videolan.org
Fri May 4 17:03:39 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May  4 17:02:59 2018 +0200| [d9faec3043dfd2705f94d4e98141dc80a7756d81] | committer: Geoffrey Métais

Use view context to get preferences

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 145b0da87..773812dea 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -408,7 +408,7 @@ public class VideoGridFragment extends MediaBrowserFragment<VideosProvider> impl
             ((MainActivity)activity).getNavigator().showSecondaryFragment(SecondaryActivity.VIDEO_GROUP_LIST, title);
         } else {
             media.removeFlags(MediaWrapper.MEDIA_FORCE_AUDIO);
-            final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(VLCApplication.getAppContext());
+            final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(v.getContext());
             if (settings.getBoolean("force_play_all", false)) {
                 final List<MediaWrapper> playList = new ArrayList<>();
                 MediaUtils.openList(activity, playList, mAdapter.getListWithPosition(playList, position));



More information about the Android mailing list