O'Reilly logo

Pro Android 3 by Sayed Y. Hashimi, Dave MacLean, Satya Komatineni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Exploring Handlers

We showed in Chapter 12 that each package runs in its own process. In this chapter, we will explain the organization of threads within this process. This will lead us to why we need handlers.

Most code in an Android application runs in the context of a component such as an Activity or a Service. We will show how these components of an application interact with threads. Most of the time there is only one thread running in an Android process called the main thread. We will talk about the implications of sharing this main thread among various components. Primarily, this can lead to Application Not Responding (ANR) messages(the "A" stands for "application" and not "Annoying"). We will show you how you can use handlers, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required