If you change the queue for the next track mediaplayer don't gets reinitialized.
This means the next song which is played is actually the one queued before change of queue.
PS2: Only setNextTrack if Service is actually playing at the moment.
PS3: Whitespace fix
PS4: Remove last track in queue case included. Space fixed
Change-Id: I9ddd762d3c42815e7b365f6a5c4b124f5d940a5a
if (mNextPlayPos >= 0 && mPlayList != null) {
final long id = mPlayList[mNextPlayPos];
mPlayer.setNextDataSource(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI + "/" + id);
+ } else {
+ mPlayer.setNextDataSource(null);
}
}
MusicUtils.getReleaseDateForAlbum(this, getAlbumId()));
} else if (what.equals(QUEUE_CHANGED)) {
saveQueue(true);
+ if (isPlaying()) {
+ setNextTrack();
+ }
} else {
saveQueue(false);
}