From 4275dd7d47ddf5a023615441389a4c3eeca42f5b Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 13 Apr 2015 08:35:19 -0700 Subject: Fix random freeze while swapping songs --- .../daneren2005/dsub/fragments/NowPlayingFragment.java | 13 ++++++++++--- 1 file 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(context) { + @Override + protected Void doInBackground() throws Throwable { + getDownloadService().swap(true, from, to); + onDownloadListChanged(); + + return null; + } + }.execute(); } }); playlistView.setRemoveListener(new DragSortListView.RemoveListener() { -- cgit v1.2.3