mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 21:58:52 +02:00
Added simple task/destroyed
This commit is contained in:
@@ -155,6 +155,7 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
||||
public void onDestroy() {
|
||||
EntityLog.log(context, EntityLog.Type.Debug, "Owner gone task=" + name);
|
||||
destroyed = true;
|
||||
onDestroyed(args);
|
||||
owner.getLifecycle().removeObserver(this);
|
||||
}
|
||||
};
|
||||
@@ -225,6 +226,7 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
||||
state = owner.getLifecycle().getCurrentState();
|
||||
if (state.equals(Lifecycle.State.DESTROYED)) {
|
||||
Log.i("Destroyed task " + name);
|
||||
onDestroyed(args);
|
||||
owner.getLifecycle().removeObserver(this);
|
||||
cleanup(context);
|
||||
} 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 onDestroyed(Bundle args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
long now = new Date().getTime();
|
||||
|
||||
Reference in New Issue
Block a user