From ba34d600af4ca9e994b90844e3ca985f8c181203 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 16 May 2019 11:24:58 +0200 Subject: [PATCH] Fixed last model --- app/src/main/java/eu/faircode/email/ViewModelMessages.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ViewModelMessages.java b/app/src/main/java/eu/faircode/email/ViewModelMessages.java index b49a9b4943..19dd07a605 100644 --- a/app/src/main/java/eu/faircode/email/ViewModelMessages.java +++ b/app/src/main/java/eu/faircode/email/ViewModelMessages.java @@ -175,7 +175,10 @@ public class ViewModelMessages extends ViewModel { } else if (viewType == AdapterMessage.ViewType.FOLDER) remove(AdapterMessage.ViewType.SEARCH); - last = viewType; + if (viewType != AdapterMessage.ViewType.THREAD) { + last = viewType; + Log.i("Last model=" + last); + } Log.i("Returning model=" + viewType); dump(); @@ -334,6 +337,7 @@ public class ViewModelMessages extends ViewModel { } void setObserver(LifecycleOwner owner, @NonNull Observer> observer) { + //list.removeObservers(owner); list.observe(owner, observer); }