Reputation: 410
I am following the answer I found here.
This is how I expect to be able to create a new Handler
and override the handleMessage()
function without having to declare it as a new class:
val handler = Handler {
override fun handleMessage(msg: Message?) {
}
}
However, this doesn't work and gives me two errors:
Modifier 'override' is not applicable to local function
Expected a value of type Boolean
How exactly can I just create a new Handler
and override the handleMessage()
function without having to declare a new class?
Upvotes: 0
Views: 877