Reputation: 1722
I see several examples, such as in this sample code in the Android dev documentation or this blog post, which suggests that the way to get an Activity context is to use the syntax this@MainActivity
. But I don't remember reading about any such syntax in Kotlin and in fact Android Studio flags it as a syntax error (unresolved reference, even with an appropriate import statement for MainActivity
). Can anyone point me to reference documentation for this Kotlin syntax?
Upvotes: 0
Views: 35