Fixed several bugs in AddFeedActivity

This commit is contained in:
daniel oeh 2012-06-21 20:58:52 +02:00
parent 088a1ad673
commit eeeff62037

View File

@ -56,7 +56,12 @@ public class AddFeedActivity extends SherlockActivity {
progDialog = new ProgressDialog(this) { progDialog = new ProgressDialog(this) {
@Override @Override
public void onBackPressed() { public void onBackPressed() {
requester.cancelDownload(getContext(), downloadId); if (isWaitingForImage) {
requester.cancelDownload(getContext(), imageDownloadId);
} else {
requester.cancelDownload(getContext(), downloadId);
}
unregisterReceiver(downloadCompleted); unregisterReceiver(downloadCompleted);
dismiss(); dismiss();
} }
@ -89,6 +94,18 @@ public class AddFeedActivity extends SherlockActivity {
Log.d(TAG, "Stopping Activity"); Log.d(TAG, "Stopping Activity");
} }
@Override
protected void onPause() {
super.onPause();
try {
unregisterReceiver(downloadCompleted);
} catch (IllegalArgumentException e) {
// ignore
}
}
private void addNewFeed() { private void addNewFeed() {
String url = etxtFeedurl.getText().toString(); String url = etxtFeedurl.getText().toString();
url = URLChecker.prepareURL(url); url = URLChecker.prepareURL(url);