From ff7a181dad8c80265ff4f72bd5d192c7c9ea4236 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 7 Jan 2020 15:18:24 +0100 Subject: [PATCH] Confirm address exceptions --- .../main/java/eu/faircode/email/FragmentCompose.java | 12 ++++++++++-- 1 file changed, 10 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 1bc37a4a7f..b4f4293695 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -3717,8 +3717,16 @@ public class FragmentCompose extends FragmentBase { if (ex instanceof MessageRemovedException) finish(); - else if (ex instanceof IllegalArgumentException || - ex instanceof AddressException || ex instanceof UnknownHostException) + else if (ex instanceof AddressException) { + final Snackbar sb = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_INDEFINITE); + sb.setAction(android.R.string.ok, new View.OnClickListener() { + @Override + public void onClick(View v) { + sb.dismiss(); + } + }); + sb.show(); + } else if (ex instanceof IllegalArgumentException || ex instanceof UnknownHostException) Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show(); else Log.unexpectedError(getParentFragmentManager(), ex);