I\'m a bit kotlin newbie and I\'m trying to remove the callback instance inside the callback itself.
What I\'m trying to achieve it\'s something similar to the follo
You need to use a full object expression syntax to refer to be able to refer to the instance itself:
private val myCallback = object: SomeInterfaceType() { override fun onSomeEvent() { if (it.something) { someObject.removeListener(this) } } }