Created
February 19, 2021 21:21
-
-
Save jeziellago/006b0a3171f4aaf430a0ac13b7fd318f 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
val mainHandler = Handler(Looper.getMainLooper()) { msg -> | |
// do something with msg | |
// Main Thread here!! | |
true | |
} | |
val imageThread = ImageFileThread(mainHandler) { | |
val message = Message().apply { | |
data = bundleOf( | |
"image_url" to "https://example.com/img.png" | |
) | |
} | |
sendMessage(message) | |
} | |
// start the thread | |
imageThread.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment