aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-03-25 19:40:57 -0700
committerScott Jackson <daneren2005@gmail.com>2013-03-25 19:40:57 -0700
commit7648260a62d422c3b1d497cf8611b0e6ebef8c1a (patch)
tree7d873da80b1b64410c73a38723136f866c723858 /subsonic-android/src/github
parent3519b29d8406d796b4d5318c62d6bf6f34d86c40 (diff)
downloaddsub-7648260a62d422c3b1d497cf8611b0e6ebef8c1a.tar.gz
dsub-7648260a62d422c3b1d497cf8611b0e6ebef8c1a.tar.bz2
dsub-7648260a62d422c3b1d497cf8611b0e6ebef8c1a.zip
Cancel HTTP request in separate thread to not throw error
Diffstat (limited to 'subsonic-android/src/github')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java
index e1f694e6..24dcbabd 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java
@@ -812,8 +812,16 @@ public class RESTMusicService implements MusicService {
task.setOnCancelListener(new CancellableTask.OnCancelListener() {
@Override
public void onCancel() {
- cancelled.set(true);
- request.abort();
+ new Thread(new Runnable() {
+ public void run() {
+ try {
+ cancelled.set(true);
+ request.abort();
+ } catch(Exception e) {
+ Log.e(TAG, "Failed to stop http task");
+ }
+ }
+ }).start();
}
});
}