Search code examples
androidbroadcastreceiverandroid-support-librarylocalbroadcastmanager

LocalBroadcastManager receiver order


Does LocalBroadcastManager guarantee the order in which registered receivers are called?

It would be handy to count on them always being called in the order they were registered. The API documentation doesn't seem to say, but maybe I missed something.


Solution

  • Does LocalBroadcastManager guarantee the order in which registered receivers are called?

    Not in any documented fashion. This is not surprising, as regular braodcasts do not guarantee any order, outside of specifically using the ordered broadcast mechanism.

    By eyeball, the current implementation suggests that local broadcasts should be sent in the order the receivers were added, based on action name. However, I would not count on that behavior.