Intents
Intents are Android's mechanism for inter-component communication. Intents are asynchronous so components fire them off and it is the onus of the receiving component to validate the incoming Intent's data and act upon it. Intents are used by the Android system for starting an Activity or Service, for communicating with a Service, to broadcast events or changes, for receiving notifications using pending Intents, and to query the Content Provider.
There are different mechanisms to handle Intents for each component. So, the Intents sent out to Activities, Services, and Broadcast Receivers are only sent to their respective counterparts by the Android system. For example, an event sent out to start an Activity using Context.startActivity()
will resolve only Activities matching the Intent criterion. Similarly, a broadcast sent out using Context.sendBroadcast()
will be received only by receivers and not by other components.
Before an Intent is sent out, it is important to check...