diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-04-13 08:35:19 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-04-13 08:35:19 -0700 |
commit | 4275dd7d47ddf5a023615441389a4c3eeca42f5b (patch) | |
tree | 9978b0b6c02b5fbb32ed271e34e36d6fd96c61db | |
parent | ff868797b593af560ed54b404b83a424ebe4227c (diff) | |
download | dsub-4275dd7d47ddf5a023615441389a4c3eeca42f5b.tar.gz dsub-4275dd7d47ddf5a023615441389a4c3eeca42f5b.tar.bz2 dsub-4275dd7d47ddf5a023615441389a4c3eeca42f5b.zip |
Fix random freeze while swapping songs
-rw-r--r-- | src/github/daneren2005/dsub/fragments/NowPlayingFragment.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java index 198e1779..4a720ead 100644 --- a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java +++ b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java @@ -521,9 +521,16 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis });
playlistView.setDropListener(new DragSortListView.DropListener() {
@Override
- public void drop(int from, int to) {
- getDownloadService().swap(true, from, to);
- onDownloadListChanged();
+ public void drop(final int from, final int to) {
+ new SilentBackgroundTask<Void>(context) {
+ @Override
+ protected Void doInBackground() throws Throwable {
+ getDownloadService().swap(true, from, to);
+ onDownloadListChanged();
+
+ return null;
+ }
+ }.execute();
}
});
playlistView.setRemoveListener(new DragSortListView.RemoveListener() {
|