diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index f35bd0b4be..e4984097cb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -302,10 +302,10 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, return true; } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.resume))) { activeloop.suspendTo(0L); + updateGUI("suspendmenu"); sHandler.post(new Runnable() { @Override public void run() { - MainApp.bus().post(new EventRefreshGui(false)); PumpEnactResult result = MainApp.getConfigBuilder().cancelTempBasal(); if (!result.success) { ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.sResources.getString(R.string.tempbasaldeliveryerror)); @@ -315,18 +315,23 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, return true; } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.suspendloopfor1h))) { activeloop.suspendTo(new Date().getTime() + 60L * 60 * 1000); + updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.suspendloopfor2h))) { activeloop.suspendTo(new Date().getTime() + 2 * 60L * 60 * 1000); + updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.suspendloopfor3h))) { activeloop.suspendTo(new Date().getTime() + 3 * 60L * 60 * 1000); + updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.suspendloopfor10h))) { activeloop.suspendTo(new Date().getTime() + 10 * 60L * 60 * 1000); + updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.disconnectpumpfor30m))) { activeloop.suspendTo(new Date().getTime() + 30L * 60 * 1000); + updateGUI("suspendmenu"); sHandler.post(new Runnable() { @Override public void run() { @@ -339,10 +344,10 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, return true; } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.disconnectpumpfor1h))) { activeloop.suspendTo(new Date().getTime() + 1 * 60L * 60 * 1000); + updateGUI("suspendmenu"); sHandler.post(new Runnable() { @Override public void run() { - MainApp.bus().post(new EventRefreshGui(false)); PumpEnactResult result = MainApp.getConfigBuilder().setTempBasalAbsolute(0d, 60); if (!result.success) { ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.sResources.getString(R.string.tempbasaldeliveryerror)); @@ -352,10 +357,10 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, return true; } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.disconnectpumpfor2h))) { activeloop.suspendTo(new Date().getTime() + 2 * 60L * 60 * 1000); + updateGUI("suspendmenu"); sHandler.post(new Runnable() { @Override public void run() { - MainApp.bus().post(new EventRefreshGui(false)); PumpEnactResult result = MainApp.getConfigBuilder().setTempBasalAbsolute(0d, 2 * 60); if (!result.success) { ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.sResources.getString(R.string.tempbasaldeliveryerror)); @@ -365,10 +370,10 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, return true; } else if (item.getTitle().equals(MainApp.sResources.getString(R.string.disconnectpumpfor3h))) { activeloop.suspendTo(new Date().getTime() + 3 * 60L * 60 * 1000); + updateGUI("suspendmenu"); sHandler.post(new Runnable() { @Override public void run() { - MainApp.bus().post(new EventRefreshGui(false)); PumpEnactResult result = MainApp.getConfigBuilder().setTempBasalAbsolute(0d, 3 * 60); if (!result.success) { ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.sResources.getString(R.string.tempbasaldeliveryerror));