summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/dialog/DownloadRequestErrorDialogCreator.java
blob: e363a6911ffa9647874091b1f7f564f9906b4d13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package de.danoeh.antennapod.dialog;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import de.danoeh.antennapod.R;

/** 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();
	}
}