Delay delivering task data

This commit is contained in:
M66B 2019-07-30 22:06:02 +02:00
parent aded278004
commit 6934feda1a
1 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
if (state.equals(Lifecycle.State.DESTROYED)) { if (state.equals(Lifecycle.State.DESTROYED)) {
// No delivery // No delivery
cleanup(context); cleanup(context);
} else if (state.isAtLeast(Lifecycle.State.STARTED)) { } else if (state.isAtLeast(Lifecycle.State.RESUMED)) {
// Inline delivery // Inline delivery
Log.i("Deliver task " + name); Log.i("Deliver task " + name);
deliver(); deliver();
@ -136,7 +136,7 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
Log.i("Destroyed task " + name); Log.i("Destroyed task " + name);
owner.getLifecycle().removeObserver(this); owner.getLifecycle().removeObserver(this);
cleanup(context); cleanup(context);
} else if (state.isAtLeast(Lifecycle.State.STARTED)) { } else if (state.isAtLeast(Lifecycle.State.RESUMED)) {
Log.i("Deferred delivery task " + name); Log.i("Deferred delivery task " + name);
owner.getLifecycle().removeObserver(this); owner.getLifecycle().removeObserver(this);
deliver(); deliver();