use variable from seperate function kotlin code example
Example: how to define variable in kotlin
val firstName: String = "Chike"
val variable name: Typeofthevariable = TheValueofyourvariable
val firstName: String = "Chike"
val variable name: Typeofthevariable = TheValueofyourvariable