Consider the following code:
val hwnd = Handler()
hwnd.postDelayed(object : Runnable {
override fun run()
hwnd.postDelayed(this, 5000)
}
}, 5000)
This way, I can post the same Runnable to the Handler by using this
(which refers to the Runnable) in the run()
method. But how could I do the same using only a lambda expression?
val hwnd = Handler()
hwnd.postDelayed({
//How to get "this" here?
}, 5000)
Is that even possible?