aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index 2191f439..f0497703 100644
--- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -63,6 +63,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
private List<MusicDirectory.Entry> entries;
private boolean albumContext = false;
private boolean addAlbumHeader = false;
+ private LoadTask currentTask;
String id;
String name;
@@ -433,6 +434,10 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
refresh = true;
}
+ if(currentTask != null) {
+ currentTask.cancel();
+ }
+
entryList.setVisibility(View.INVISIBLE);
if (playlistId != null) {
getPlaylist(playlistId, playlistName, refresh);
@@ -599,6 +604,8 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
public LoadTask() {
super(SelectDirectoryFragment.this);
+
+ currentTask = this;
}
protected abstract MusicDirectory load(MusicService service) throws Exception;
@@ -622,6 +629,8 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
}
licenseValid = result.getSecond();
finishLoading();
+
+ currentTask = null;
}
}