From bb35f58eab8d804d06395e1a56d4dfd392aecd98 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Fri, 12 May 2017 18:31:52 +0200 Subject: [PATCH] Get correct calibration value if entered with (onboard) keyboard --- .../plugins/Overview/Dialogs/CalibrationDialog.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/CalibrationDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/CalibrationDialog.java index 6ff9dceb1f..d13243e66a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/CalibrationDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/CalibrationDialog.java @@ -26,6 +26,7 @@ import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.GlucoseStatus; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile; import info.nightscout.utils.PlusMinusEditText; +import info.nightscout.utils.SafeParse; import info.nightscout.utils.XdripCalibrations; public class CalibrationDialog extends DialogFragment implements View.OnClickListener { @@ -34,6 +35,7 @@ public class CalibrationDialog extends DialogFragment implements View.OnClickLis Button okButton; PlusMinusEditText bgText; TextView unitsView; + TextView bgView; Context context; @@ -72,6 +74,7 @@ public class CalibrationDialog extends DialogFragment implements View.OnClickLis unitsView = (TextView) view.findViewById(R.id.overview_calibration_units); unitsView.setText(units); + bgView = (TextView) view.findViewById(R.id.overview_calibration_bg); return view; } @@ -80,7 +83,7 @@ public class CalibrationDialog extends DialogFragment implements View.OnClickLis public void onClick(View view) { switch (view.getId()) { case R.id.overview_calibration_okbutton: - final Double bg = bgText.getValue(); + final Double bg = SafeParse.stringToDouble(this.bgView.getText().toString());; XdripCalibrations.confirmAndSendCalibration(bg, context); dismiss(); Answers.getInstance().logCustom(new CustomEvent("Calibration"));