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开始,系统对静态注册的广播会有所限制,无法使用清单为大多数隐式广播声明接收方。

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

你可能感兴趣的:(Android8.0以上静态注册广播无法接收的问题)