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 @Override
public void onPause() { public void onPause() {
running = false;
super.onPause(); super.onPause();
MainApp.unsubscribe(this); MainApp.unsubscribe(this);
running = false;
if (L.isEnabled(L.UI)) if (L.isEnabled(L.UI))
log.debug("onPause"); log.debug("onPause");
} }
@ -173,10 +173,12 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL
Activity activity = getActivity(); Activity activity = getActivity();
if (activity != null) { if (activity != null) {
activity.runOnUiThread(() -> { activity.runOnUiThread(() -> {
try {
if (running) {
if (L.isEnabled(L.UI)) if (L.isEnabled(L.UI))
log.debug("executing"); log.debug("executing");
try {
dismiss(); dismiss();
}
} catch (Exception e) { } catch (Exception e) {
log.error("Unhandled exception", e); log.error("Unhandled exception", e);
} }