[Android] Prevent/catch exception happening on Android 2.x

Geoffrey Métais git at videolan.org
Tue Mar 24 15:28:37 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Mar 24 13:31:08 2015 +0100| [022a06b2d56440146523380efbccec0ff5b5f6f3] | committer: Geoffrey Métais

Prevent/catch exception happening on Android 2.x

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=022a06b2d56440146523380efbccec0ff5b5f6f3
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
index 0bc6e83..c10911a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
@@ -116,7 +116,10 @@ public class VideoListAdapter extends ArrayAdapter<MediaWrapper>
     }
 
     public void sort() {
-        super.sort(this);
+        if (!isEmpty())
+            try {
+                super.sort(this);
+            } catch (ArrayIndexOutOfBoundsException e) {} //Exception happening on Android 2.x
     }
 
     @Override



More information about the Android mailing list