Design-Patterns-In-Kotlin icon indicating copy to clipboard operation
Design-Patterns-In-Kotlin copied to clipboard

Add println() inside PrintingTextChangedListener in Observer pattern otherwise we don't get any output

Open MirzalievPulat opened this issue 2 years ago • 0 comments

`class PrintingTextChangedListener : TextChangedListener {

private var text = ""

override fun onTextChanged(oldText: String, newText: String) {
    text = "Text is changed: $oldText -> $newText"
    println(text) // here 
}

}`

MirzalievPulat avatar Nov 14 '23 12:11 MirzalievPulat