Answers for "execute after delay kotlin"

1

how to call a function after delay in kotlin android

// Android 10+ Handler() is depricated
// Import
import android.os.Handler;
import android.os.Looper

val handler = Handler(Looper.getMainLooper())
handler.postDelayed({
  // do something after 1000ms
}, 1000)
Posted by: Guest on November-13-2020
-3

use delay kotlin

Timer().schedule(2000) {
    TODO("Do something")
}
Posted by: Guest on June-26-2021

Code answers related to "execute after delay kotlin"

Browse Popular Code Answers by Language