diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2015-10-30 12:16:14 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2015-10-30 12:25:13 +0100 |
commit | 663c0fd8be37ecc160a3b6336df17c5e592db75f (patch) | |
tree | a21ae7561293dc7cfda4eee6d133fad231b99f40 /core/src/main/java | |
parent | c9986edc5ed7a97c20cf259e79055f486bdca5d1 (diff) | |
download | AntennaPod-663c0fd8be37ecc160a3b6336df17c5e592db75f.zip |
Don't let the user cancel the ProgressDialog
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java index 255b95119..bea8d2afd 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java @@ -3,15 +3,14 @@ package de.danoeh.antennapod.core.asynctask; import android.annotation.SuppressLint; import android.app.ProgressDialog; import android.content.Context; -import android.content.DialogInterface; -import android.content.DialogInterface.OnCancelListener; import android.os.AsyncTask; + +import java.util.concurrent.ExecutionException; + import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.storage.DBWriter; -import java.util.concurrent.ExecutionException; - /** Removes a feed in the background. */ public class FeedRemover extends AsyncTask<Void, Void, Void> { Context context; @@ -35,12 +34,7 @@ public class FeedRemover extends AsyncTask<Void, Void, Void> { } return null; } - - @Override - protected void onCancelled() { - dialog.dismiss(); - } - + @Override protected void onPostExecute(Void result) { dialog.dismiss(); @@ -50,15 +44,8 @@ public class FeedRemover extends AsyncTask<Void, Void, Void> { protected void onPreExecute() { dialog = new ProgressDialog(context); dialog.setMessage(context.getString(R.string.feed_remover_msg)); - dialog.setOnCancelListener(new OnCancelListener() { - - @Override - public void onCancel(DialogInterface dialog) { - cancel(true); - - } - - }); + dialog.setIndeterminate(true); + dialog.setCancelable(false); dialog.show(); } |