July 2, 2023

Android - how to delay in Android/Kotlin

There are subtle points in doing this. Do you use a separate thread? Do you want your app to be unresponsible during the delay interval? This is the method most encouraged:
Handler().postDelayed({
    TODO("Do something")
    }, 2000)
Note that "better" here has to do with "in the context of Android".
Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org