As the title, is there any way to call a function after delay (1 second for example) in Kotlin?
Kotlin
A simple example to show a toast after 3 seconds :
fun onBtnClick() { val handler = Handler() handler.postDelayed({ showToast() }, 3000) } fun showToast(){ Toast.makeText(context, "Its toast!", Toast.LENGTH_SHORT).show() }