From b34abdc3388e09bcc1cde8dc9d95194b9c48eb18 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 11 Aug 2018 20:10:49 +0000 Subject: [PATCH] Quick fix for attaching --- .../main/java/eu/faircode/email/FragmentCompose.java | 10 +++++++++- 1 file changed, 9 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 8d0c8b6f..86366189 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -96,6 +96,7 @@ public class FragmentCompose extends FragmentEx { private AdapterAttachment adapter; + private boolean attaching = false; private String action = null; private long id = -1; // draft id private long account = -1; @@ -318,7 +319,8 @@ public class FragmentCompose extends FragmentEx { @Override public void onPause() { - onAction(R.id.action_save); + if (!attaching) + onAction(R.id.action_save); super.onPause(); } @@ -349,6 +351,7 @@ public class FragmentCompose extends FragmentEx { } private void onMenuAttachment() { + attaching = true; Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("*/*"); @@ -486,6 +489,11 @@ public class FragmentCompose extends FragmentEx { } } + @Override + public void onLoaded(Bundle args, Void data) { + attaching = false; + } + @Override public void onException(Bundle args, Throwable ex) { Toast.makeText(getContext(), ex.toString(), Toast.LENGTH_LONG).show();