diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 8d0c8b6ff4..8636618967 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();