type mismatch required:Editabel Found:String

Issue

I am new to programming so any help would be appreciated

buFindAge.setOnClickListener {
val YearOfBirth:Int=txtYearOfBirth.toString().toInt()
val myAge:Int=2018-YearOfBirth
 tvShowAge.text=myAge.toString()
 tvShowAge.text="$myAge"  // Same error
    }

Solution

Use .setText() instead of text=

Answered By – Alvaro

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published