25 Loopers, Handlers, and HandlerThread
Now that you have downloaded and parsed JSON data from Flickr, your next task is to download and display images. In this chapter, you will learn how to use Looper, Handler, and HandlerThread to dynamically download and display photos in PhotoGallery. Along the way you will gain a deeper understanding of your app’s main thread and further explore restrictions around what work can be done on the main thread versus what work can be done on a background thread. Finally, you will learn how to communicate between the main thread and a background thread.