|
|
@ -155,6 +155,7 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
|
|
|
public void onDestroy() {
|
|
|
|
public void onDestroy() {
|
|
|
|
EntityLog.log(context, EntityLog.Type.Debug, "Owner gone task=" + name);
|
|
|
|
EntityLog.log(context, EntityLog.Type.Debug, "Owner gone task=" + name);
|
|
|
|
destroyed = true;
|
|
|
|
destroyed = true;
|
|
|
|
|
|
|
|
onDestroyed(args);
|
|
|
|
owner.getLifecycle().removeObserver(this);
|
|
|
|
owner.getLifecycle().removeObserver(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -225,6 +226,7 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
|
|
|
state = owner.getLifecycle().getCurrentState();
|
|
|
|
state = owner.getLifecycle().getCurrentState();
|
|
|
|
if (state.equals(Lifecycle.State.DESTROYED)) {
|
|
|
|
if (state.equals(Lifecycle.State.DESTROYED)) {
|
|
|
|
Log.i("Destroyed task " + name);
|
|
|
|
Log.i("Destroyed task " + name);
|
|
|
|
|
|
|
|
onDestroyed(args);
|
|
|
|
owner.getLifecycle().removeObserver(this);
|
|
|
|
owner.getLifecycle().removeObserver(this);
|
|
|
|
cleanup(context);
|
|
|
|
cleanup(context);
|
|
|
|
} else if (state.isAtLeast(Lifecycle.State.RESUMED)) {
|
|
|
|
} else if (state.isAtLeast(Lifecycle.State.RESUMED)) {
|
|
|
@ -366,6 +368,9 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
|
|
|
protected void onPostExecute(Bundle args) {
|
|
|
|
protected void onPostExecute(Bundle args) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void onDestroyed(Bundle args) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
public String toString() {
|
|
|
|
long now = new Date().getTime();
|
|
|
|
long now = new Date().getTime();
|
|
|
|