Created
November 13, 2019 13:06
-
-
Save john-lorrenz/9352879fe78c194df89a821ffae49a11 to your computer and use it in GitHub Desktop.
Delay code in Android without making the UI freeze
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import | |
import android.os.Handler; | |
// Use | |
val handler = Handler() | |
handler.postDelayed({ | |
// do something after 1000ms | |
}, 1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment