This PR adds support for calling registerBroadcastReceiver multiple times, while retaining previous registrations. Callbacks are associated with a new HashMap, which also retains all BroadcastReceiver objects.
unregisterBroadcastReceiver now unregisters all receivers; to support backwards compatibility.
I tried to minimize the scope of this change, so other methods like onIntent and onActivityResult continue to only support one registration. This meets all of my use cases, but if you'd prefer to update the other methods for consistency, let me know. Thanks!
Fixes #131
This PR adds support for calling
registerBroadcastReceiver
multiple times, while retaining previous registrations. Callbacks are associated with a newHashMap
, which also retains allBroadcastReceiver
objects.unregisterBroadcastReceiver
now unregisters all receivers; to support backwards compatibility.I tried to minimize the scope of this change, so other methods like
onIntent
andonActivityResult
continue to only support one registration. This meets all of my use cases, but if you'd prefer to update the other methods for consistency, let me know. Thanks!