I want the text written inside the EditText to be displayed simultaneously in the TextView without pressing the button (kotlin)
thank you
Add a TextWatcher
and in afterTextChanged
update the TextView
editText.addextChangedListener(object: TextWatcher {
...
override fun afterTextChanged(s: Editable?) {
s?.let { textView.text = it.toString() }
}
})
Or if you're using the androidx.core:core-ktx
library:
editText.doAfterTextChanged { editable ->
editable?.let { textView.text = it.toString()
}