[Android] Fix folders contextual menu

Geoffrey Métais git at videolan.org
Thu Sep 28 11:41:49 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Sep 28 11:40:55 2017 +0200| [7eef291a10f9ec42435129c05e4ccb66ef446805] | committer: Geoffrey Métais

Fix folders contextual menu

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

 .../src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java       | 6 +++---
 1 file changed, 3 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 3aaa8e1d4..32226b4cf 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -500,11 +500,11 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
     }
 
     protected void setContextMenuItems(Menu menu, int position) {
-        MediaWrapper mw = (MediaWrapper) mAdapter.getItem(position);
-        int type = mw.getType();
+        final MediaWrapper mw = (MediaWrapper) mAdapter.getItem(position);
+        final int type = mw.getType();
         boolean canWrite = this instanceof FileBrowserFragment && FileUtils.canWrite(mw.getUri().getPath());
         if (type == MediaWrapper.TYPE_DIR) {
-            boolean isEmpty = Util.isListEmpty(mFoldersContentLists.get(position));
+            final boolean isEmpty = Util.isListEmpty(mFoldersContentLists.get(mw));
 //                if (canWrite) {
 //                    boolean nomedia = new File(mw.getLocation() + "/.nomedia").exists();
 //                    menu.findItem(R.id.directory_view_hide_media).setVisible(!nomedia);



More information about the Android mailing list