Closed aenonGit closed 2 years ago
Why? If it finds matches it will add the component to it
It calls setComponent
rewriting value from the previous iteration. This means that, if any matching receiver is registered in Manifest, the broadcast will be explicitly routed to one of these manifest receivers.
yes but in reality there should be only one matching receiver. Anyway if you have a better approach it will be very welcome :)
It's a normal situation when there's one receiver in Application which listens for incoming calls and one in call Activity listening to call state. It's better to remove the loop with setComponent() at all.
but that's not the case, because there should be only one matching receiver registered in the manifest (which listens to incoming/outgoing/missed calls) all the other receivers (e.g. call state) are not receiving broadcast through the explicit one. If look at it, the "sendExplicitBroadcast" is used only in those three cases and it matches only explicitly registered receiver in the manifest
The for-loop left is nonsense now.