aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-09-03 10:33:24 -0700
committerScott Jackson <daneren2005@gmail.com>2014-09-03 10:33:24 -0700
commit68a35817c58f22457df3de4f2be81f53b1a2adba (patch)
treeb0003829c01101e488d4f5e34ad545014381e112 /src
parent5c5c8f910f30de813f5624245272b7965d35c4b6 (diff)
downloaddsub-68a35817c58f22457df3de4f2be81f53b1a2adba.tar.gz
dsub-68a35817c58f22457df3de4f2be81f53b1a2adba.tar.bz2
dsub-68a35817c58f22457df3de4f2be81f53b1a2adba.zip
Move playNow into LoadingTask to be same as download
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/fragments/SubsonicFragment.java27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
index 3bc9b874..24f7341e 100644
--- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
@@ -1462,15 +1462,24 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
protected void playNow(List<Entry> entries, int position) {
playNow(entries, entries.get(0), position);
}
- protected void playNow(List<Entry> entries, Entry song, int position) {
- DownloadService downloadService = getDownloadService();
- if(downloadService == null) {
- return;
- }
-
- downloadService.clear();
- downloadService.download(entries, false, true, true, false, entries.indexOf(song), position);
- Util.startActivityWithoutTransition(context, DownloadActivity.class);
+ protected void playNow(final List<Entry> entries, final Entry song, final int position) {
+ new LoadingTask<Void>(context) {
+ @Override
+ protected Void doInBackground() throws Throwable {
+ DownloadService downloadService = getDownloadService();
+ if(downloadService == null) {
+ return;
+ }
+
+ downloadService.clear();
+ downloadService.download(entries, false, true, true, false, entries.indexOf(song), position);
+ }
+
+ @Override
+ protected void done(Void result) {
+ Util.startActivityWithoutTransition(context, DownloadActivity.class);
+ }
+ }.execute();
}
protected void deleteBookmark(final MusicDirectory.Entry entry, final ArrayAdapter adapter) {