Hander and message
1.hander
action: Accepts data from a child thread (message or Runable object) to update the bound object.
Why it appears:
There are some time-consuming actions in Android or other applications, and if they all appear in the main thread, you can't do anything else when they do. Then people think, can you apply for some "resources", Designed to handle this time-consuming operation without affecting the current process.so multithreading out, the corresponding, put some things in the other threads in the execution, at this time, we will take it as a sub-thread (we open), the system or we are using is called the main thread.
Next, when the thread operation is complete, it needs to communicate with the main thread,,,,, originally, asynchronous processing like this is complicated, but the advent of handler in Android makes the job instantly simple.
so the emergence of handler is mainly to solve the asynchronous information processing, not to be forced to say is to solve the problem of communication between the threads.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
An analysis of handler and message in Android (i.)