How is an event captured from a View object? There is only one thread running : the UI thread (when we haven\'t implemented any of our own threads). Suppose if I have implem
Internally, Android is running an event loop to handle UI events. For a nice diagram, see a third slide of this presentation. This thread is being used to dispatch system calls to the UI elements:
The system does not create a separate thread for each instance of a component. All components that run in the same process are instantiated in the UI thread, and system calls to each component are dispatched from that thread.
(source: Processes and Threads)
Have a look at a Inside the Android Application Framework video from Google I/O 2008. It has the nice explanation of the event loop (consisting of Looper and Message Queue). The interesting stuff starts at around 26m into the video.
The onClick() method will be called from the same thread from which the original setOnClickListener() was called. If it was a main/UI thread, then you should be vary of performing long-running tasks in the listener - they will block the UI thread and can cause the app to be non-responsive. Use solutions like AsyncTask instead.
Please look at this blog post for detailed tutorial.