From 5a5d89563f2e4ca577b29895fd4368d2783d5f27 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 2 Nov 2018 19:04:16 +0100 Subject: [PATCH] Fix BolusProgressDialog --- .../plugins/Overview/Dialogs/BolusProgressDialog.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java index 1baac9a694..6ac7d13cfa 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java @@ -107,9 +107,9 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL @Override public void onPause() { + running = false; super.onPause(); MainApp.unsubscribe(this); - running = false; if (L.isEnabled(L.UI)) log.debug("onPause"); } @@ -173,10 +173,12 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL Activity activity = getActivity(); if (activity != null) { activity.runOnUiThread(() -> { - if (L.isEnabled(L.UI)) - log.debug("executing"); try { - dismiss(); + if (running) { + if (L.isEnabled(L.UI)) + log.debug("executing"); + dismiss(); + } } catch (Exception e) { log.error("Unhandled exception", e); }