官方說明: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開始躲惰,系統(tǒng)對靜態(tài)注冊的廣播會有所限制,無法使用清單為大多數(shù)隱式廣播聲明接收方考赛。
倘若要繼續(xù)使用,可以這樣子實(shí)現(xiàn)斤富,如下圖: