From 4124ece4ea413deccf96b0f7b4eb72bec2d8f511 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 14 Sep 2018 05:26:21 +0000 Subject: [PATCH] Fixed simple task reload --- app/src/main/java/eu/faircode/email/SimpleTask.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/SimpleTask.java b/app/src/main/java/eu/faircode/email/SimpleTask.java index d7769a83..3daaca1e 100644 --- a/app/src/main/java/eu/faircode/email/SimpleTask.java +++ b/app/src/main/java/eu/faircode/email/SimpleTask.java @@ -43,9 +43,9 @@ import androidx.lifecycle.OnLifecycleEvent; public abstract class SimpleTask implements LifecycleObserver { private LifecycleOwner owner; - private boolean paused = false; - private Bundle args = null; - private Result stored = null; + private boolean paused; + private Bundle args; + private Result stored; private ExecutorService executor = Executors.newCachedThreadPool(Helper.backgroundThreadFactory); @@ -113,6 +113,9 @@ public abstract class SimpleTask implements LifecycleObserver { private void run(final Context context, LifecycleOwner owner, final Bundle args) { this.owner = owner; + this.paused = false; + this.args = null; + this.stored = null; owner.getLifecycle().addObserver(this); // Run in background thread