Horje
how to call a function after delay in kotlin android Code Example
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)
handler in kotlin to delay
// Import
import android.os.Handler;

// Use
val handler = Handler()
handler.postDelayed({
     // do something after 1000ms
}, 1000)




2

Related
Kotlin round double string Code Example Kotlin round double string Code Example
kotlin check if string contains Code Example kotlin check if string contains Code Example
android recyclerview scroll to bottom Code Example android recyclerview scroll to bottom Code Example
how to handle onbackpressed in fragment Code Example how to handle onbackpressed in fragment Code Example
kotlin global constants Code Example kotlin global constants Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9