Get immediate access to this and over 1,500+ other videos and books.

Boost your skills with a raywenderlich.com Beginner subscription. With over 60+ video courses and our core foundational programming books bundled in one subscription, it’s simply the best investment you can make in your development career.

Launch Threads & Post to the Main Thread

The student materials have been reviewed and are updated as of SEPTEMBER 2022. The image desplayed for the first project(and therefore its url) has changed. Don’t worry, the code stays the same :]

Introduce the projects you’ll use in the course, set up your IDE, and repeat the concepts you’ve learned in previous courses about threading.

Contributors

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.

This course has a few sample projects you’ll use to learn about background processing in Android.

val imageUrl = URL("https://cdn.pixabay.com/photo/2018/01/14/23/12/nature-3082832__480.jpg")
val connection = imageUrl.openConnection() as HttpURLConnection
connection.doInput = true
connection.connect()

val inputStream = connection.inputStream
val bitmap = BitmapFactory.decodeStream(inputStream)

image.setImageBitmap(bitmap)
Thread(Runnable {

}).start()
runOnUiThread { ... }

Reviews

Comments