[Android] Display chapter's position if no description

Geoffrey Métais git at videolan.org
Tue Mar 31 15:09:12 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Mar 31 15:07:55 2015 +0200| [0c6edc1db0771aaf65d17f3f8f1e071cafd5022a] | committer: Geoffrey Métais

Display chapter's position if no description

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

 .../src/org/videolan/vlc/gui/video/AdvOptionsDialog.java        |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java b/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java
index fa3c8ad..d37164b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java
@@ -183,8 +183,11 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
             return;
         }
         ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_spinner_item);
-        for (int i = 0 ; i < chaptersCount ; ++i)
-            adapter.insert(mLibVLC.getChapterDescription(i), i);
+        String chapterDescription;
+        for (int i = 0 ; i < chaptersCount ; ++i) {
+            chapterDescription = mLibVLC.getChapterDescription(i);
+            adapter.insert(chapterDescription != null ? chapterDescription : Integer.toString(i), i);
+        }
         adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
         mChapters.setAdapter(adapter);
         mChapters.setSelection(mLibVLC.getChapter());



More information about the Android mailing list