I am using code below to execute certain task every 5 minutes.
Do coroutines have anything like this built into them?
Is there any better way of doing this?
private val interval = 1000*60*5L
private val handler:Handler = Handler()
val mHandlerTask = object : Runnable {
override fun run() {
val id: String = getId(this@HomeActivity)
settingsViewModel.Settings(id)
handler.postDelayed(this, interval)
}
}
Thanks