Created
February 19, 2021 21:17
-
-
Save jeziellago/a6fe3b5f461090b1e9df2ee53ceca930 to your computer and use it in GitHub Desktop.
This file contains 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
class MyCustomThread : Thread() { | |
var handler: Handler? = null | |
override fun run() { | |
Looper.prepare() | |
handler = Handler(checkNotNull(Looper.myLooper())) { msg: Message -> | |
// do something with the received Message | |
true | |
} | |
Looper.loop() | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment