If the broadcastPermission argument is non-null then the registered BroadcastReceiver cannot receive broadcast Intents from any Application which has not been granted the specified permission. If the scheduler argument is non-null then the registered BroadcastReceiver’s onReceive() method will be executed in the context of the specified Handler. If it is not necessary to specify either a permission or a Handler then an implementation of the android.content.Context public abstract Intent registerReceiver(
BroadcastReceiver receiver,
IntentFilter filter) method can be used instead. Both methods will return either a broadcast Intent which was sent in sticky
mode which matches the given IntentFilter, or null. (See also. Both methods can also be used to access a stick
broadcast Intent directlyThe same BroadcastReceiver can be registered multiple times with different IntentFilters.
Share with your friends: