Same Receiver in several different apps
I have three different versions of my app. Each version has its own small application project, and all three apps share a common library project which contains the bulk of the code and resources. So, the 开发者_StackOverflowfollowing packages are involved:
com.mycompany.myapp.app1
com.mycompany.myapp.app2
com.mycompany.myapp.app3
com.mycompany.myapp.lib
The library project includes a Receiver
which I use to listen for the android.intent.action.BOOT_COMPLETED
intent. The Receiver
is registered in each of the projects' AndroidManifest.xml
files with its fully qualified name:
<receiver android:name="com.mycompany.myapp.lib.MyBootReceiver">
I am now seeing that on reboot, if I have all three versions of the app installed side-by-side, only one of them is having its Receiver
called. Is this because the Receiver
is declared with the same name for each app? Should each app have its own separately-named version of the Receiver
instead?
精彩评论