此IntentService(代碼段中的NotificationService)未啓動並且未收到這些意向。通過在Application類中爲他們註冊一個接收器,我已經驗證了這些Intents正在播出。我只是想在應用程序未啓動時獲取它們。IntentService未從清單註冊中獲取意圖
<service
android:name=".services.NotificationService">
<intent-filter>
<action android:name="com.redactedtoprotecttheinnocent.ACTION_INCOMING_CALL"/>
<action android:name="com.redactedtoprotecttheinnocent.ACTION_CALL_STATUS_CHANGE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
什麼可能是錯在這裏有什麼建議?我寧願不創建一個廣播接收器來啓動一個IntentService。
啊,謝謝你的澄清。我無法改變電話廣播是如何進來的,所以聽起來好像有一個接收器剛開始這項服務就是這裏的方法。 – Turnsole
@Tnsnsole:準信息總線上有三個信道是「意圖」系統:活動,服務和廣播。一個頻道上的消息(例如廣播)僅在該頻道上消費。他們只能跨越頻道(例如,廣播 - >服務),如果您將其移動到頻道上的話。 – CommonsWare