Perhaps this will help, too get my questions answered:

Of course, I see in

http://developer.android.com/reference/android/os/Handler.html

a description of how the handler is used from the application's main
thread: "When a process is created for your application, its main
thread is dedicated to running a message queue that takes care of
managing the top-level application objects (activities, broadcast
receivers, etc) and any windows they create. You can create your own
threads, and communicate back with the main application thread through
a Handler. This is done by calling the same post or sendMessage
methods as before, but from your new thread. The given Runnable or
Message will than be scheduled in the Handler's message queue and
processed when appropriate. "

What that doesn't answer though is this: given the following code
snippet, how does the application know to send messages to
LooperThread?  mHandler is just an object reference created and
doesn't get sent anywhere....

  class LooperThread extends Thread {
      public Handler mHandler;

      public void run() {
          Looper.prepare();

          mHandler = new Handler() {
              public void handleMessage(Message msg) {
                  // process incoming messages here
              }
          };

          Looper.loop();
      }
  }


Thanks.

Richard

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to