kotlin delay
Timer().schedule(2000) {
TODO("Do somefing")
}
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)
andoird kotlin delay
Handler().postDelayed({
//doSomethingHere()
}, 1000)
use delay kotlin
Timer().schedule(2000) {
TODO("Do something")
}
handler in kotlin to delay
// Import
import android.os.Handler;
// Use
val handler = Handler()
handler.postDelayed({
// do something after 1000ms
}, 1000)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us