NewCarbsDialog: correct situation where Hypo TT can't be unchecked.

This commit is contained in:
Johannes Mockenhaupt 2018-07-24 12:48:50 +02:00
parent 026c9f4788
commit 39dc914c2c
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -157,10 +157,12 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, C
BgReading bgReading = DatabaseHelper.actualBg();
if (bgReading != null && bgReading.value < 72) {
startHypoTTCheckbox.setOnCheckedChangeListener(null);
startHypoTTCheckbox.setChecked(true);
// see #onCheckedChanged why listeners are registered like this
startHypoTTCheckbox.setOnClickListener(this);
} else {
startHypoTTCheckbox.setOnCheckedChangeListener(this);
}
startHypoTTCheckbox.setOnCheckedChangeListener(this);
setCancelable(true);
getDialog().setCanceledOnTouchOutside(false);