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
).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…