I have a main activity and bound service. The bound service receives a command from the network, which triggers a Message to be sent to a Handler in the main activity. I got everything to work by passing the Handler's reference to the service. And then... I stumbled across this thing called a Messenger.
Messenger: Reference to a Handler, which others can use to send messages to it. This allows for the implementation of message-based communication across processes, by creating a Messenger pointing to a Handler in one process, and handing that Messenger to another process.
This inspired a few questions:
- Does the term process mean I won't need to use a Messenger unless I generate a separate process under the Process and Thread guidelines?
- Is it always good practice to use a Messenger?
- Is passing a reference to the Handler typically a bad idea?