blob: d808d2ac22bf103830f5865dd8d03e101bd60fa2 (
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
|
package de.podfetcher.util;
import de.podfetcher.R;
import android.app.DownloadManager;
import android.content.Context;
/** Utility class for Download Errors. */
public class DownloadError {
/** Get a human-readable string for a specific error code. */
public static String getErrorString(Context context, int code) {
int resId;
switch(code) {
case DownloadManager.ERROR_DEVICE_NOT_FOUND:
resId = R.string.download_error_insufficient_space;
break;
case DownloadManager.ERROR_FILE_ERROR:
resId = R.string.download_error_file_error;
break;
case DownloadManager.ERROR_HTTP_DATA_ERROR:
resId = R.string.download_error_http_data_error;
break;
default:
resId = R.string.download_error_error_unknown;
}
return context.getString(resId);
}
}
|