diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-06-17 14:16:54 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-06-17 14:16:54 +0200 |
commit | 307ab0939455623b704f35849875973e4fea0708 (patch) | |
tree | a195420b19da5453420d6d29b64f84538cb427bb /src/de | |
parent | 9cad737be2afc219c3f670fa67bd5c3b645dee1f (diff) | |
download | AntennaPod-307ab0939455623b704f35849875973e4fea0708.zip |
Cancelling a download will now notify the download service
Diffstat (limited to 'src/de')
-rw-r--r-- | src/de/podfetcher/storage/DownloadRequester.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/de/podfetcher/storage/DownloadRequester.java b/src/de/podfetcher/storage/DownloadRequester.java index 17b32bd93..6680ebda5 100644 --- a/src/de/podfetcher/storage/DownloadRequester.java +++ b/src/de/podfetcher/storage/DownloadRequester.java @@ -119,6 +119,7 @@ public class DownloadRequester { downloads.remove(f); f.setFile_url(null); } + notifyDownloadService(context); } } @@ -180,6 +181,7 @@ public class DownloadRequester { * ------------- */ private DownloadService mService = null; + private Context mContext = null; boolean mIsBound; private ServiceConnection mConnection = new ServiceConnection() { @@ -187,10 +189,13 @@ public class DownloadRequester { mService = ((DownloadService.LocalBinder) service).getService(); Log.d(TAG, "Connection to service established"); mService.queryDownloads(); + mContext.unbindService(mConnection); } public void onServiceDisconnected(ComponentName className) { mService = null; + mIsBound = false; + mContext = null; Log.i(TAG, "Closed connection with DownloadService."); } }; @@ -199,9 +204,7 @@ public class DownloadRequester { public void notifyDownloadService(Context context) { context.bindService(new Intent(context, DownloadService.class), mConnection, Context.BIND_AUTO_CREATE); + mContext = context; mIsBound = true; - - context.unbindService(mConnection); - mIsBound = false; } } |