From ef804f49316872c25b42ac4a11b3c02a00425096 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 7 Sep 2018 10:45:43 +0000 Subject: [PATCH] Fixed editing of custom accounts --- app/src/main/java/eu/faircode/email/FragmentAccount.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index 92e75acdce..47a0933bb3 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -750,15 +750,21 @@ public class FragmentAccount extends FragmentEx { if (savedInstanceState == null) { if (account != null) { + boolean found = false; for (int pos = 2; pos < providers.size(); pos++) { Provider provider = providers.get(pos); if (provider.imap_host.equals(account.host) && provider.imap_port == account.port) { + found = true; spProvider.setTag(pos); spProvider.setSelection(pos); break; } } + if (!found) { + spProvider.setTag(1); + spProvider.setSelection(1); + } etHost.setText(account.host); etPort.setText(Long.toString(account.port)); }