Hi I am making a app with Kotlin and I found that I can both use
textView.setText(str)
and
textView.text =
Both works the same way.
Java Convention
textView.setText(“…”)
Kotlin Convention
textView.text=”…”
“Methods that follow the Java conventions for getters and setters (no-argument methods with names starting with get and single-argument methods with names starting with set) are represented as properties in Kotlin.”- documentation
thus textView.text=”…”
instead of textView.setText(“…”)
if you are using Kotlin to follow Kotlin Conventions.
Ref - Begin Kotlin; from an Activity, a Button and a TextView