Fixed several bugs in AddFeedActivity

This commit is contained in:
daniel oeh 2012-06-21 20:58:52 +02:00
parent 088a1ad673
commit eeeff62037
1 changed files with 18 additions and 1 deletions

View File

@ -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();
}
@ -89,6 +94,18 @@ public class AddFeedActivity extends SherlockActivity {
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();
url = URLChecker.prepareURL(url);