Android8.0以上静态注册广播无法接收的问题

官方说明:Beginning with Android 8.0 (API level 26), the system imposes additional restrictions on manifest-declared receivers. If your app targets API level 26 or higher, you cannot use the manifest to declare a receiver for most implicit broadcasts (broadcasts that do not target your app specifically).

大概意思是从8.0开始,系统对静态注册的广播会有所限制,无法使用清单为大多数隐式广播声明接收方。

倘若要继续使用,可以这样子实现,如下图:

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容