Clarification on the Order of Broadcast Intent Processing


#1

I worked through the chapter on Broadcast Intents, and it is unclear to me how StartupReceiver processes the Broadcast Intent before the receiver initialized by VisibleFragment (and hence, PhotoGalleryFragment) does…if that is even the case. In particular, I’m trying to decipher the architecture described in figure 30.5 on page 496. I think it’s quite clear that NotificationReceiver processes last. However, what pieces of code make the order of processing explicit? That’s just escaping me at the moment…any help would be greatly appreciated.


#2

Q1 how StartupReceiver processes the Broadcast Intent before the receiver initialized by VisibleFragment (and hence, PhotoGalleryFragment) does
A1 StartupReceiver listened to the intent with BOOT_COMPLETED. Because it was registered in the manifest, it can receive the broadcast even the PhotoGallery app not started. Most of your apps are not started at the time the BOOT_COMPLETED broadcasted. So, it is clear StartupReceiver processes the Broadcast Intent before the receiver initialized by VisibleFragment.

Q2 what pieces of code make the order of processing explicit
A2 If I am not misunderstood, the code android:priority="-999" makes the NotificationReceiver processes last, if it is your mean.