Run start service on foreground

This commit is contained in:
M66B
2021-03-25 09:36:45 +01:00
parent a2f78423df
commit f7a85deeec
18 changed files with 263 additions and 114 deletions

View File

@@ -611,8 +611,6 @@ public class FragmentPop extends FragmentBase {
db.endTransaction();
}
ServiceSynchronize.eval(context, "POP3");
if (!synchronize) {
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.cancel("receive:" + account.id, 1);
@@ -634,8 +632,10 @@ public class FragmentPop extends FragmentBase {
fragment.show(getParentFragmentManager(), "account:save");
} else {
Context context = getContext();
if (context != null)
if (context != null) {
ServiceSynchronize.eval(context, "POP3");
WidgetUnified.updateData(context); // Update color stripe
}
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
getParentFragmentManager().popBackStack();
@@ -879,13 +879,15 @@ public class FragmentPop extends FragmentBase {
DB db = DB.getInstance(context);
db.account().setAccountTbd(id);
ServiceSynchronize.eval(context, "delete account");
return null;
}
@Override
protected void onExecuted(Bundle args, Void data) {
Context context = getContext();
if (context != null)
ServiceSynchronize.eval(context, "delete account");
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
getParentFragmentManager().popBackStack();
}