Android Studio – Why is this function not called?



I’m learning Android Studio & Kotlin and came across a interesting error.
enter image description here

Notice how the squeezeState() is in red, or says that the function doesn’t exist even though its at the bottom and has been declared properly.
Why doesn’t Kotlin pickup the function reference?


I realise that this isn’t JavaScript and that you need to declare the function before calling it

Answered By – Joy Singh

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

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More