From ee62bce4627de522e8d9f083b5216d6ed6a0af25 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 27 Mar 2020 14:44:22 +0100 Subject: [PATCH] Fixed adding photos on some Android versions/variants --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 2142c75af2..44d357460d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1589,13 +1589,18 @@ public class FragmentCompose extends FragmentBase { onAddImage(data.getBundleExtra("args").getBoolean("photo")); break; case REQUEST_IMAGE_FILE: - case REQUEST_TAKE_PHOTO: if (resultCode == RESULT_OK && data != null) { - Uri uri = (requestCode == REQUEST_TAKE_PHOTO ? photoURI : data.getData()); + Uri uri = data.getData(); if (uri != null) onAddImageFile(uri); } break; + case REQUEST_TAKE_PHOTO: + if (resultCode == RESULT_OK) { + if (photoURI != null) + onAddImageFile(photoURI); + } + break; case REQUEST_ATTACHMENT: case REQUEST_RECORD_AUDIO: if (resultCode == RESULT_OK && data != null)