https://kotlinlang.org logo
r

robin

02/16/2017, 2:05 PM
Instead of this:
Copy code
lateinit var foo: String
You do this:
Copy code
var foo: String? = null
Now you can check if there's a value there by doing this:
Copy code
if(foo != null) {
    // Okay, foo is initialized, do something with it
}