Skip to content
Snippets Groups Projects
Commit 1f245e48 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

MediaList: increase count after items move

Prevent ArrayIndexOutOfBoundsException
parent 4f3173b0
No related branches found
No related tags found
No related merge requests found
......@@ -106,10 +106,9 @@ public class MediaList extends VLCObject<MediaList.Event> {
}
private synchronized Media insertMediaFromEvent(int index) {
mCount++;
for (int i = mCount - 1; i >= index; --i)
mMediaArray.put(i + 1, mMediaArray.valueAt(i));
mCount++;
final Media media = new Media(this, index);
mMediaArray.put(index, media);
return media;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment