diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-09-23 16:40:44 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-09-23 16:40:44 +0200 |
commit | 92feabbb5d2cf1362812a5c71bc27d9b8820093f (patch) | |
tree | 2dc22dd97bc764b0de97683653a69f6e36e4f66b /src/de/danoeh/antennapod/dialog | |
parent | aeed5871e447d5d13f4daeaf0543304000158af9 (diff) | |
download | AntennaPod-92feabbb5d2cf1362812a5c71bc27d9b8820093f.zip |
DownloadRequester now throws an exception if request is invalid
Diffstat (limited to 'src/de/danoeh/antennapod/dialog')
-rw-r--r-- | src/de/danoeh/antennapod/dialog/DownloadRequestErrorDialogCreator.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/de/danoeh/antennapod/dialog/DownloadRequestErrorDialogCreator.java b/src/de/danoeh/antennapod/dialog/DownloadRequestErrorDialogCreator.java new file mode 100644 index 000000000..349b39682 --- /dev/null +++ b/src/de/danoeh/antennapod/dialog/DownloadRequestErrorDialogCreator.java @@ -0,0 +1,31 @@ +package de.danoeh.antennapod.dialog; + +import de.danoeh.antennapod.R; +import android.app.AlertDialog; +import android.app.AlertDialog.Builder; +import android.content.Context; +import android.content.DialogInterface; + +/** Creates Alert Dialogs if a DownloadRequestException has happened. */ +public class DownloadRequestErrorDialogCreator { + private DownloadRequestErrorDialogCreator() { + } + + public static void newRequestErrorDialog(Context context, + String errorMessage) { + AlertDialog.Builder builder = new AlertDialog.Builder(context); + builder.setNeutralButton(android.R.string.ok, + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }) + .setTitle(R.string.download_error_request_error) + .setMessage( + context.getString(R.string.download_request_error_dialog_message_prefix) + + errorMessage); + builder.create().show(); + } +} |