are multiple broadcast receivers legal in android?

倾然丶 夕夏残阳落幕 提交于 2019-12-04 04:09:52

The quoted passage is from the documentation for Google's mobile analytics package. It may be that Google's mobile analytics package cannot support more than one BroadcastReceiver for Google's mobile analytics package's broadcasts.

Android itself can most certainly have more than one BroadcastReceiver per application.

The Android platform only delivers the install tracking intent to a single "receiver" for your application. What they mean is, if you are using two install trackers for your application you can not put two receivers containing the same action "com.android.vending.INSTALL_REFERRER". If this is the case, then you can add a meta-data tag like

<meta-data android:name="forward.1"  android:value="<other receiver's name>" />

to your receiver so both receivers receive the Intent.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!