That’s the cuestion , i have:
- Activity A
- Activity B
From A i want to communicate with B , then i use a Handler created on B to do it this way:
ActivityB.handlerB.sendMessage(msg);
Then what i don’t know if it would use the ActivityA thread , or the ActivityB thread .
In order to let ActivityB Thread do the work , Is it well done?
Unless ActvityB created handlerB using a non-default Looper, all messages sent to handlerB will only deliver their messages on the same thread that handlerB was created within.
So, for example, if ActivityB created handler in a very typical way, from an activity event callback, handlerB will deliver its messages to the default UI thead.
So, if ActivityB is made like this, ActivityA is safe to call handlerB.sendMessage():
So, for most circumstances, your answer is: Yes.