Le code :
var shouldStopLoop = false
val handler = object : Handler()
val runnable = object: Runnable //error occurs here
{
override fun run() {
getSubsData()
if(!shouldStopLoop)
{
handler.postDelayed(this, 5000)
}
}
}
handler.post(runnable)
Expecting a class body
L'erreur se produit lorsque j'essaie de créer le val runnable
.