I am creating an Android Studio app in the Kotlin language and that utilizes the doAfterTextChanged function as a TextWatcher for an editText. However, when the user changes the text in the editText after it has already been changed, the app crashes. Is there any alternative (and simple) function I can use or something to add to my program. Here is an example of what I currently have:
editText.doAfterTextChanged() {
score = score + 15 * editText.text.toString().toInt()
totalscore.text = "Score: " + score.toString()
}