From f24503148833a01c202436822c4d78db67da56ab Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 3 Dec 2018 18:37:03 +0100 Subject: [PATCH] Workaround selection tracker crash --- .../main/java/eu/faircode/email/FragmentMessages.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 6419aec600..0e0db13f93 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -395,11 +395,16 @@ public class FragmentMessages extends FragmentEx { selectionTracker.addObserver(new SelectionTracker.SelectionObserver() { @Override public void onSelectionChanged() { - if (selectionTracker.hasSelection()) + if (selectionTracker.hasSelection()) { + if (messages != null) { + messages.removeObservers(getViewLifecycleOwner()); + messages = null; + } fabMore.show(); - else { + } else { fabMore.hide(); predicate.clearAccount(); + loadMessages(); } } });