Android 學習之問題記錄:《第一行程式碼》第六章:8.0及以上版本無法在Mainfest中自定義大多數broadcast reciever

lzp1467188465發表於2020-09-29

摘自:https://developer.android.google.cn/guide/components/broadcasts#manifest-declared-receivers

問題記錄:

Android 8.0

Beginning with Android 8.0 (API level 26), the system imposes additional restrictions on manifest-declared receivers.

If your app targets Android 8.0 or higher, you cannot use the manifest to declare a receiver for most implicit broadcasts (broadcasts that don't target your app specifically). You can still use a context-registered receiver when the user is actively using your app.

Android 8.0

從 Android 8.0(API 級別 26)開始,系統對清單宣告的接收器施加了額外的限制。

如果您的應用以 Android 8.0 或更高版本為目標平臺,那麼對於大多數隱式廣播(沒有明確針對您的應用的廣播),您不能使用清單來宣告接收器。當使用者正在活躍地使用您的應用時,您仍可使用上下文註冊的接收器

 

Note: If your app targets API level 26 or higher, you cannot use the manifest to declare a receiver for implicit broadcasts (broadcasts that do not target your app specifically), except for a few implicit broadcasts that are exempted from that restriction. In most cases, you can use scheduled jobs instead.

注意:如果您的應用以 API 級別 26 或更高階別的平臺版本為目標,則不能使用清單為隱式廣播(沒有明確針對您的應用的廣播)宣告接收器,但一些不受此限制的隱式廣播除外。在大多數情況下,您可以使用排程作業來代替。

解決方法:(尚不知如何解決,在此先記錄一下)

 

相關文章