temp fix of bolus progress crash
This commit is contained in:
parent
38ee1402a4
commit
08d940b2fb
2 changed files with 10 additions and 5 deletions
|
@ -351,9 +351,9 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
|
||||||
|
|
||||||
PumpEnactResult result = activePump.deliverTreatment(insulin, carbs, context);
|
PumpEnactResult result = activePump.deliverTreatment(insulin, carbs, context);
|
||||||
|
|
||||||
bolusProgressDialog.bolusEnded = true;
|
BolusProgressDialog.bolusEnded = true;
|
||||||
|
|
||||||
if (bolusProgressDialog != null && bolusProgressDialog.running) {
|
if (bolusProgressDialog != null && BolusProgressDialog.running) {
|
||||||
try {
|
try {
|
||||||
bolusProgressDialog.dismiss();
|
bolusProgressDialog.dismiss();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -393,9 +393,9 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
|
||||||
|
|
||||||
PumpEnactResult result = activePump.deliverTreatment(insulin, carbs, context);
|
PumpEnactResult result = activePump.deliverTreatment(insulin, carbs, context);
|
||||||
|
|
||||||
bolusProgressDialog.bolusEnded = true;
|
BolusProgressDialog.bolusEnded = true;
|
||||||
|
|
||||||
if (bolusProgressDialog != null && bolusProgressDialog.running) {
|
if (bolusProgressDialog != null && BolusProgressDialog.running) {
|
||||||
try {
|
try {
|
||||||
bolusProgressDialog.dismiss();
|
bolusProgressDialog.dismiss();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -146,13 +146,18 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
BolusProgressDialog.bolusEnded = true;
|
||||||
Activity activity = getActivity();
|
Activity activity = getActivity();
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
activity.runOnUiThread(
|
activity.runOnUiThread(
|
||||||
new Runnable() {
|
new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
try {
|
||||||
dismiss();
|
dismiss();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace(); // TODO: do this better way
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue