In Kotlin, is there a way to reference the listener instance when using this short notation for anonymous classes? In this case this refers to outer context (e.
You can get that resolved by adding an @ActivityName in front of 'this' reference
For example if your Activity name was MainActivity the solution would be:
view.setOnClickListener {
val self: View.OnClickListener = this@MainActivity
}