Fixed IllegalStateException when deleting multiple songs
This commit is contained in:
parent
b2dbfd3083
commit
97c56f9e57
6 changed files with 25 additions and 15 deletions
|
@ -1190,7 +1190,7 @@ public class MusicService extends MediaBrowserServiceCompat
|
|||
notifyChange(QUEUE_CHANGED);
|
||||
}
|
||||
|
||||
public void removeSong(@NonNull Song song) {
|
||||
public void removeSongImpl(@NonNull Song song) {
|
||||
for (int i = 0; i < playingQueue.size(); i++) {
|
||||
if (playingQueue.get(i).getId() == song.getId()) {
|
||||
playingQueue.remove(i);
|
||||
|
@ -1202,6 +1202,17 @@ public class MusicService extends MediaBrowserServiceCompat
|
|||
originalPlayingQueue.remove(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void removeSong(@NonNull Song song) {
|
||||
removeSongImpl(song);
|
||||
notifyChange(QUEUE_CHANGED);
|
||||
}
|
||||
|
||||
public void removeSongs(@NonNull List<Song> songs) {
|
||||
for (Song song : songs) {
|
||||
removeSongImpl(song);
|
||||
}
|
||||
notifyChange(QUEUE_CHANGED);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue