Hi I am making a app with Kotlin and I found that I can both use
textView.setText(str)
and
textView.text =
As in the Kotlin, you are not using findViewById
so to access your textView, import statement must be like this
import kotlinx.android.synthetic.main..*
And textView.text = $str
is the Synthetic Property access provided by Kotlin Plugin for android
You can use both, not much difference in the usability, but for the easier code writing this would be better
For more information, read this https://kotlinlang.org/docs/tutorials/android-plugin.html