I am trying to understand the main differences between registering a BroadcastReceiver in the Manifest and registering it programmatically...
My understanding is basically as follows (would appreciate someone correcting my points if I am missing something).
Registered in Manifest:
Registered Programmatically:
thanks
You have it basically correct.
Note that a manifest-registered receiver object is only used once. A new instance of your BroadcastReceiver
is created for each broadcast. The primary use of manifest-registered receivers is for broadcasts that may go on while your code is not in memory (e.g., BOOT_COMPLETED
, your scheduled alarms via AlarmManager
).