From 08d940b2fb5ae4b46bdb01a1eea9456ec8f1c7ea Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 18 Aug 2016 09:10:32 +0200 Subject: [PATCH] temp fix of bolus progress crash --- .../plugins/ConfigBuilder/ConfigBuilderPlugin.java | 8 ++++---- .../plugins/Overview/Dialogs/BolusProgressDialog.java | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index e3caaf81ff..b02aa6ebf7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -351,9 +351,9 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain PumpEnactResult result = activePump.deliverTreatment(insulin, carbs, context); - bolusProgressDialog.bolusEnded = true; + BolusProgressDialog.bolusEnded = true; - if (bolusProgressDialog != null && bolusProgressDialog.running) { + if (bolusProgressDialog != null && BolusProgressDialog.running) { try { bolusProgressDialog.dismiss(); } catch (Exception e) { @@ -393,9 +393,9 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain PumpEnactResult result = activePump.deliverTreatment(insulin, carbs, context); - bolusProgressDialog.bolusEnded = true; + BolusProgressDialog.bolusEnded = true; - if (bolusProgressDialog != null && bolusProgressDialog.running) { + if (bolusProgressDialog != null && BolusProgressDialog.running) { try { bolusProgressDialog.dismiss(); } catch (Exception e) { 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 6984397f4f..55d54cbee5 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 @@ -146,13 +146,18 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL } catch (InterruptedException e) { e.printStackTrace(); } + BolusProgressDialog.bolusEnded = true; Activity activity = getActivity(); if (activity != null) { activity.runOnUiThread( new Runnable() { @Override public void run() { - dismiss(); + try { + dismiss(); + } catch (Exception e) { + e.printStackTrace(); // TODO: do this better way + } } }); }