Reputation: 55
I would like to access a Broadcast Receiver declared in the manifest to be able to register it for some intent which requires explicit registration (using registerReceiver()
) like Intent.ACTION_PACKAGE_ADDED
. How can I do that?
TIA
Upvotes: 1
Views: 229
Reputation: 1006869
what I would like is to register the instance created by the App from the manifest
A manifest-registered receiver is only created when a matching broadcast is sent, and it lives long enough for a single onReceive()
call. So, there is "the instance created by the App from the manifest" that you can obtain at other times. You need to create your own instance to use with registerReceiver()
.
Upvotes: 1