3
I was generating an action by clicking on a Button
fun cliqueBotao(view : View){
var texto = findViewById<>(R.id.textoExibicao) as TextView
texto.setText("Texto alterado")
}
Only that Android Studio kept complaining that findViewById<>
is no parameter. I did a quick search and noticed that some methods put the value passed by parameter when the method is created fun cliqueBotao(view : View)
within the findViewById<>
And my method was like this
fun cliqueBotao(view : View){
var texto = findViewById<View>(R.id.textoExibicao) as TextView
texto.setText("Texto alterado")
}
So far my App is working normal, because before needed and now needs and this way is correct?
Thank you in advance