diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 3c0ae51fbc..8765373b2f 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -250,11 +250,28 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB getSupportFragmentManager().addOnBackStackChangedListener(this); DB.getInstance(this).account().liveAccounts(true, threading).observe(this, new Observer>() { + private List last = new ArrayList<>(); + @Override public void onChanged(@Nullable List accounts) { if (accounts == null) accounts = new ArrayList<>(); + boolean same = true; + if (accounts.size() == last.size()) { + for (int i = 0; i < accounts.size(); i++) + if (accounts.get(i).equals(last.get((i)))) { + same = false; + break; + } + } else + same = false; + + if (same) + return; + else + last = accounts; + ArrayAdapterDrawer drawerArray = new ArrayAdapterDrawer(ActivityView.this); final Collator collator = Collator.getInstance(Locale.getDefault());