- Is it not possible to change the text of
EditText
inafterTextChanged
- It gives the error below
- Is there a specific way to change the text
code:
inputEmail.addTextChangedListener(object :TextWatcher{
override fun afterTextChanged(s: Editable?) {
inputEmail.setText("123456")
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
})
Error:
at com.caring2u.organizer.ui.fragments.screen.FrgBookingDetails$setEditTextListeners$4.afterTextChanged(FrgBookingDetails.kt:256)
at android.widget.TextView.sendAfterTextChanged(TextView.java:9605)
at android.widget.TextView.setText(TextView.java:5496)
at android.widget.TextView.setText(TextView.java:5343)
at android.widget.EditText.setText(EditText.java:113)
at android.widget.TextView.setText(TextView.java:5300)