In essence, the broadcast mechanism of the Android system is a message subscription/publishing mechanism. Therefore, the first step to use this message-driven model is to subscribe to messages. for Android applications, subscribing to a message is actually registering a broadcast receiver.
Two registration methods are available: static registration and dynamic registration. In the Broadcast Mechanism of Android, the priority of Dynamic Registration is higher than that of static registration. Therefore, when necessary, we need to dynamically register the broadcast receiver.
Let's review static registration. The so-called registration is to register the broadcast receiver in Manifest. xml.
[Java]
<Cycler android: name = "">
<Intent-filter android: priority = "2147483647">
<Action android: name = "android. provider. Telephony. SMS_RECEIVED">
</Action>
</Intent-filter>
</Cycler>
Then create a class that inherits BroadcastReceiver. Specifically, the priority in the intent-filter label sets the priority of the broadcast receiver. Many data on the Internet shows that the priority value is set to 1000 ~ -2147483647, is the largest, but in fact, when the priority value is the maximum integer value, it is the highest priority, that is,; of course, the "highest" is limited to static registration.
Understanding