diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 3a6e320567..52c4138299 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -252,6 +252,7 @@ public class FragmentCompose extends FragmentBase { private State state = State.NONE; private boolean show_images = false; private int last_available = 0; // attachments + private boolean saved = false; private Uri photoURI = null; @@ -665,6 +666,10 @@ public class FragmentCompose extends FragmentBase { case R.id.action_send: onAction(R.id.action_check, "check"); break; + case R.id.action_save: + saved = true; + onAction(action, "save"); + break; default: onAction(action, "navigation"); } @@ -2755,7 +2760,7 @@ public class FragmentCompose extends FragmentBase { private void onExit() { if (state == State.LOADED) { state = State.NONE; - if (isEmpty()) + if (!saved && isEmpty()) onAction(R.id.action_delete, "empty"); else { Bundle extras = new Bundle(); @@ -3659,6 +3664,8 @@ public class FragmentCompose extends FragmentBase { } } } else { + args.putBoolean("saved", true); + if (data.draft.revision == null) { data.draft.revision = 1; data.draft.revisions = 1; @@ -3737,6 +3744,8 @@ public class FragmentCompose extends FragmentBase { encrypt = data.draft.ui_encrypt; getActivity().invalidateOptionsMenu(); + saved = args.getBoolean("saved"); + // Show identities AdapterIdentitySelect iadapter = new AdapterIdentitySelect(getContext(), data.identities); spIdentity.setAdapter(iadapter);