Added explicit cleanup

This commit is contained in:
M66B
2019-07-10 09:35:20 +02:00
parent 35f254eade
commit 2067d89666
4 changed files with 68 additions and 22 deletions

View File

@@ -233,12 +233,6 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
drawerLayout.closeDrawer(drawerContainer);
onMenuPrivacy();
}
}, new Runnable() {
@Override
public void run() {
drawerLayout.closeDrawer(drawerContainer);
onCleanup();
}
}));
menus.add(new NavMenuItem(R.drawable.baseline_info_24, R.string.menu_about, new Runnable() {
@@ -437,21 +431,6 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
Helper.view(this, Helper.getIntentPrivacy());
}
private void onCleanup() {
new SimpleTask<Void>() {
@Override
protected Void onExecute(Context context, Bundle args) {
WorkerCleanup.cleanup(context, true);
return null;
}
@Override
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getSupportFragmentManager(), ex);
}
}.execute(this, new Bundle(), "cleanup:run");
}
private void onMenuAbout() {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getSupportFragmentManager().popBackStack("about", FragmentManager.POP_BACK_STACK_INCLUSIVE);