From 83c806a774a09d54a0ef84ec5400c348256ff03b Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Sat, 17 Jan 2015 20:53:25 -0500 Subject: [PATCH] Fix string substitutions with unknown filetypes --- src/main/java/eu/siacs/conversations/utils/UIHelper.java | 4 ++-- src/main/res/values/strings.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java index f468d9ae0..86bc3f387 100644 --- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java @@ -175,10 +175,10 @@ public class UIHelper { try { mime = URLConnection.guessContentTypeFromName(path); } catch (final StringIndexOutOfBoundsException ignored) { - return ""; + return context.getString(R.string.file); } if (mime == null) { - return ""; + return context.getString(R.string.file); } else if (mime.startsWith("audio/")) { return context.getString(R.string.audio); } else if(mime.startsWith("video/")) { diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index fb6878ce9..e9699745d 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -362,6 +362,7 @@ Choose file Receiving %1$s (%2$d%% completed) Download %s + file Open %s sending (%1$d%% completed) Preparing file for transmission