[Android] Use view context to get preferences

Geoffrey Métais git at videolan.org
Fri May 4 16:16:43 CEST 2018


vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May  4 16:14:25 2018 +0200| [34c45f98fe1786106d38e154e90c3f38035c2dfb] | committer: Geoffrey Métais

Use view context to get preferences

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

 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 7e1781254..057b47f22 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -538,7 +538,7 @@ public class VideoGridFragment extends SortableFragment<VideoListAdapter> implem
             ((MainActivity)activity).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