1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Extract constant for default file name

This commit is contained in:
cketti 2015-02-04 21:16:08 +01:00
parent 36abde2c0b
commit 9814442de4

View File

@ -30,6 +30,8 @@ class DownloadImageTask extends AsyncTask<String, Void, String> {
};
private static final int DISPLAY_NAME_INDEX = 1;
private static final String DEFAULT_FILE_NAME = "saved_image";
private final Context context;
@ -61,7 +63,7 @@ class DownloadImageTask extends AsyncTask<String, Void, String> {
filename = UrlEncodingHelper.decodeUtf8(path.substring(start + 1));
} else {
// Use a dummy filename if necessary
filename = "saved_image";
filename = DEFAULT_FILE_NAME;
}
// Get the MIME type if we couldn't find a file extension
@ -86,7 +88,7 @@ class DownloadImageTask extends AsyncTask<String, Void, String> {
// Use a dummy filename if necessary
if (filename == null) {
filename = "saved_image";
filename = DEFAULT_FILE_NAME;
}
// Get the MIME type if we couldn't find a file extension