Fix string substitutions with unknown filetypes

This commit is contained in:
Sam Whited 2015-01-17 20:53:25 -05:00
parent c17005218f
commit 83c806a774
2 changed files with 3 additions and 2 deletions

View file

@ -175,10 +175,10 @@ public class UIHelper {
try { try {
mime = URLConnection.guessContentTypeFromName(path); mime = URLConnection.guessContentTypeFromName(path);
} catch (final StringIndexOutOfBoundsException ignored) { } catch (final StringIndexOutOfBoundsException ignored) {
return ""; return context.getString(R.string.file);
} }
if (mime == null) { if (mime == null) {
return ""; return context.getString(R.string.file);
} else if (mime.startsWith("audio/")) { } else if (mime.startsWith("audio/")) {
return context.getString(R.string.audio); return context.getString(R.string.audio);
} else if(mime.startsWith("video/")) { } else if(mime.startsWith("video/")) {

View file

@ -362,6 +362,7 @@
<string name="choose_file">Choose file</string> <string name="choose_file">Choose file</string>
<string name="receiving_x_file">Receiving %1$s (%2$d%% completed)</string> <string name="receiving_x_file">Receiving %1$s (%2$d%% completed)</string>
<string name="download_x_file">Download %s</string> <string name="download_x_file">Download %s</string>
<string name="file">file</string>
<string name="open_x_file">Open %s</string> <string name="open_x_file">Open %s</string>
<string name="sending_file">sending (%1$d%% completed)</string> <string name="sending_file">sending (%1$d%% completed)</string>
<string name="preparing_file">Preparing file for transmission</string> <string name="preparing_file">Preparing file for transmission</string>