Handling the Handler
One of the most interesting and useful types in the Android SDK is the Handler class. Most of the time, it is used to process messages and schedule a task to run at a future time.
This chapter explains what the class is good for and offers examples.
The android.os.Handler class is an exciting utility class that, among others, can be scheduled do execute a Runnable at a future time. Any task assigned to a Handler will run on the Handler’s thread. In turn, the Handler runs on the thread that created it, which in most cases would be the UI thread. As such, you should not schedule a long-running task with a Handler because it would make your application freeze. However, you can use a Handler to handle a long-running ...