I need to be able to handle/catch Intents while my Activity is closed. So I am looking at either a Service or a BroadcastReceiver.
Is it possible to \"receive\" i
Broadcast Receivers are application components that can run independent of Activities and Services, so the use-case you describe is definitely supported.
If you register an intent-filter
tag for the broadcast Intents you want to handle in the receiver
manifest node, it will receive all the matching broadcast Intents even if your application process is completely dead (no Activities or Services).
The following snippet shows how you would add a Broadcast Receiver to your manifest to listen for a broadcast Intent, independent of an Activity or Service running.
Within your Broadcast Receiver implementation, the onReceive
handler will be called when the Intent action for which you specified an intent-filter is broadcast.
Note: There are certain system broadcast's that you can't capture this way, but generally speaking this is the approach to take for responding to system events when you have no Activity running.