Simplification

This commit is contained in:
M66B 2022-04-23 08:35:36 +02:00
parent e35cbf2c90
commit 337db180f0
1 changed files with 4 additions and 5 deletions

View File

@ -268,11 +268,10 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
}
void cancel(Context context) {
if (future != null)
if (future.cancel(false)) {
Log.i("Cancelled task=" + name);
cleanup(context);
}
if (future != null && future.cancel(false)) {
Log.i("Cancelled task=" + name);
cleanup(context);
}
}
private void cleanup(Context context) {