From a245ed28da48af2d7dd1949ad44e0c3b86f59e00 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 29 Jun 2020 19:29:06 +0200 Subject: [PATCH] Fallback once --- app/src/main/java/eu/faircode/email/ViewModelMessages.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ViewModelMessages.java b/app/src/main/java/eu/faircode/email/ViewModelMessages.java index bc4e747cb6..98fad35e84 100644 --- a/app/src/main/java/eu/faircode/email/ViewModelMessages.java +++ b/app/src/main/java/eu/faircode/email/ViewModelMessages.java @@ -255,6 +255,7 @@ public class ViewModelMessages extends ViewModel { Log.d("Observe previous/next id=" + id); model.list.observe(owner, new Observer>() { + private boolean fallback = false; @Override public void onChanged(PagedList messages) { @@ -283,6 +284,11 @@ public class ViewModelMessages extends ViewModel { Log.w("Observe previous/next gone id=" + id); + if (fallback) + return; + + fallback = true; + Bundle args = new Bundle(); args.putLong("id", id);