diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt index c1ed8faf5b..16d41ef689 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt @@ -103,7 +103,7 @@ class TempTargetDialog : DialogFragmentWithDate() { val adapterReason = ArrayAdapter(context, R.layout.spinner_centered, reasonList) binding.reason.adapter = adapterReason - binding.targetCancel.setOnClickListener { shortClick(it) } + binding.targetCancel.setOnClickListener { binding.duration.value = 0.0; shortClick(it) } binding.eatingSoon.setOnClickListener { shortClick(it) } binding.activity.setOnClickListener { shortClick(it) } binding.hypo.setOnClickListener { shortClick(it) } @@ -149,10 +149,6 @@ class TempTargetDialog : DialogFragmentWithDate() { binding.duration.value = defaultValueHelper.determineHypoTTDuration().toDouble() binding.reason.setSelection(reasonList.indexOf(rh.gs(R.string.hypo))) } - - R.id.cancel -> { - binding.duration.value = 0.0 - } } }