There are two types of broadcast receiver registration: static registration and dynamic registration.
The difference between the two and Their Broadcast Reception:
1. Dynamic Registration BroadcastAlways fasterStatic registration broadcast, no matter how high the static registration priority is, no matter how low the Dynamic Registration priority is> \
2. Dynamic Registration broadcast is notResident BroadcastThat is, the life cycle of the broadcast following the activity. Note: remove the broadcast receiver before the activity ends.
Static registration is residentThat is to say, when the application is closed, if information is broadcast, the program will be automatically run by the system call.
3. In the same priority, whoever starts fast first will receive the broadcast first.
Dynamic Registration Code:
Updatebroadcast broadcast = new updatebroadcast (); intentfilter filter = new intentfilter ("com. Unit. Update"); registerreceiver (broadcast, filter );
Static registration code (added in the configuration file ):
<Cycler Android: Name = "net. youmi. android. adcycler "> <intent-filter> <action Android: Name =" android. intent. action. package_added "/> <data Android: Scheme =" package "/> </intent-filter> </Cycler>
Differences between static and dynamic registration broadcasts