Commit 0c6edc1d authored by Geoffrey Métais's avatar Geoffrey Métais

Display chapter's position if no description

parent 00818700
......@@ -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());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment