From 701c7985195131aafdcc4a3175f46b7c067818db Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 6 Jan 2019 14:48:25 +0000 Subject: [PATCH] Fixed selecting single attachment --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index ea6ffcfb44..b85ec99997 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -926,13 +926,18 @@ public class FragmentCompose extends FragmentEx { } else if (requestCode == ActivityCompose.REQUEST_ATTACHMENT) { if (data != null) { ClipData clipData = data.getClipData(); - if (clipData != null) + if (clipData == null) { + Uri uri = data.getData(); + if (uri != null) + handleAddAttachment(uri, false); + } else { for (int i = 0; i < clipData.getItemCount(); i++) { ClipData.Item item = clipData.getItemAt(i); Uri uri = item.getUri(); if (uri != null) handleAddAttachment(uri, false); } + } } } else if (requestCode == ActivityCompose.REQUEST_ENCRYPT) { if (data != null) {