1 | initial version |
Here's an example of how to use Kotlin to change the text displayed in a TextView on an Android device:
For example:
val myTextView = findViewById<TextView>(R.id.my_textview)
For example:
myTextView.setText("Hello, world!")
Alternatively, you can use the shorthand syntax:
myTextView.text = "Hello, world!"
That's it! Now the text displayed in the TextView will be updated with the new text you provided.