Fix BolusProgressDialog

This commit is contained in:
Milos Kozak 2018-11-02 19:04:16 +01:00
parent 8d4c5d4087
commit 5a5d89563f

View file

@ -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(() -> {
try {
if (running) {
if (L.isEnabled(L.UI))
log.debug("executing");
try {
dismiss();
}
} catch (Exception e) {
log.error("Unhandled exception", e);
}