Each application in Android can register its own broadcasts of interest so that the program will only receive the broadcast content that it cares about, either from the system or from other applications. Android provides a complete set of APIs that allow applications to freely send and receive broadcasts. Sending a broadcast is the use of a previously known intent, and a broadcast receiver (broadcast receiver) is required to receive the broadcast.
1. Type of broadcast
- Standard broadcast : Normal broadcast, is a fully asynchronous broadcast, after the broadcast, all broadcast receivers almost all at the same time to receive this broadcast message, so they do not have any sequencing Can say. This broadcast is more efficient and also means that it cannot be truncated .
- Orderly broadcast : Ordered broadcast, is a synchronous broadcast, after the broadcast, only one broadcast receiver will be able to receive this broadcast at the same time, when the logic in this broadcast receiver is executed, The broadcast will continue to pass. So at this time the broadcast receiver is sequential , the priority of the broadcast receiver can first accept the broadcast message, and the front of the broadcast receiver can also truncate the broadcast is being delivered , so that the subsequent broadcast receiver will not be able to receive broadcast messages.
Android Basics (4)--Broadcast receivers