Fix BolusProgressDialog
This commit is contained in:
parent
8d4c5d4087
commit
5a5d89563f
1 changed files with 6 additions and 4 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue