[Android] Fix outOfIndex exception
Jean-Baptiste Kempf
git at videolan.org
Sat Apr 5 00:49:58 CEST 2014
vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Apr 2 20:19:14 2014 +0200| [1218c045475d3454ea62bf2a85ecf4aaf460aee6] | committer: Jean-Baptiste Kempf
Fix outOfIndex exception
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=1218c045475d3454ea62bf2a85ecf4aaf460aee6
---
.../src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
index f477492..ebcb2be 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
@@ -332,7 +332,7 @@ public class AudioBrowserListAdapter extends BaseAdapter {
public ArrayList<String> getLocations(int position) {
// Return all the media locations of a list item list.
ArrayList<String> locations = new ArrayList<String>();
- if (!mItems.get(position).mIsSeparator) {
+ if (position < mItems.size() && !mItems.get(position).mIsSeparator) {
ArrayList<Media> mediaList = mItems.get(position).mMediaList;
for (int i = 0; i < mediaList.size(); ++i)
locations.add(mediaList.get(i).getLocation());
More information about the Android
mailing list