From eeeff62037d625f3902a6e83e062095fb4c7a1de Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Thu, 21 Jun 2012 20:58:52 +0200 Subject: Fixed several bugs in AddFeedActivity --- src/de/podfetcher/activity/AddFeedActivity.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/de/podfetcher') diff --git a/src/de/podfetcher/activity/AddFeedActivity.java b/src/de/podfetcher/activity/AddFeedActivity.java index 9cd8c5467..e43617c0d 100644 --- a/src/de/podfetcher/activity/AddFeedActivity.java +++ b/src/de/podfetcher/activity/AddFeedActivity.java @@ -56,7 +56,12 @@ public class AddFeedActivity extends SherlockActivity { progDialog = new ProgressDialog(this) { @Override public void onBackPressed() { - requester.cancelDownload(getContext(), downloadId); + if (isWaitingForImage) { + requester.cancelDownload(getContext(), imageDownloadId); + } else { + requester.cancelDownload(getContext(), downloadId); + } + unregisterReceiver(downloadCompleted); dismiss(); } @@ -88,6 +93,18 @@ public class AddFeedActivity extends SherlockActivity { super.onStop(); Log.d(TAG, "Stopping Activity"); } + + @Override + protected void onPause() { + super.onPause(); + try { + unregisterReceiver(downloadCompleted); + } catch (IllegalArgumentException e) { + // ignore + } + + } + private void addNewFeed() { String url = etxtFeedurl.getText().toString(); -- cgit v1.2.3