[Android] DirectoryViewFragment: fix item selection in a folder with subfolers
Edward Wang
git at videolan.org
Mon Jul 29 10:14:28 CEST 2013
vlc-ports/android | branch: 0.1.x-bugfix | Edward Wang <edward.c.wang at compdigitec.com> | Sat Jul 27 14:45:22 2013 -0400| [7d8d89058467da4e5118e9b86d20f1021d20de3a] | committer: Jean-Baptiste Kempf
DirectoryViewFragment: fix item selection in a folder with subfolers
Should also fix many IndexOutOfBoundsExceptions
(cherry picked from commit 9cc7bce9cf8f177777a3b0f050d7f4336b8dfcc9)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=7d8d89058467da4e5118e9b86d20f1021d20de3a
---
vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
index e90bc90..5d7abcd 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
@@ -21,6 +21,7 @@
package org.videolan.vlc.gui;
import java.io.IOException;
+import java.util.List;
import org.videolan.libvlc.LibVLC;
import org.videolan.vlc.AudioServiceController;
@@ -172,7 +173,8 @@ public class DirectoryViewFragment extends SherlockListFragment implements ISort
try {
if (LibVLC.getExistingInstance() == null
|| !LibVLC.getExistingInstance().hasVideoTrack(mediaFile)) {
- audioController.load(mDirectoryAdapter.getAllMediaLocations(), p-1); /* p-1 to exclude ".," */
+ List<String> mediaLocations = mDirectoryAdapter.getAllMediaLocations();
+ audioController.load(mediaLocations, mediaLocations.indexOf(mediaFile));
AudioPlayerActivity.start(getActivity());
} else {
VideoPlayerActivity.start(getActivity(), mediaFile);
More information about the Android
mailing list