Search code examples
androidbroadcastreceiver

Does the android application that registered a BroadcastReceiver receive a broadcast if it is no running?


If I have android application that registered a BroadcastReceiver, can the application receive the broadcast if the application is not running in the time the broadcast is triggered ?

If NO, how can I make it receive broadcasts when the application is not running ?

thanks,


Solution

  • can the application receive the broadcast if the application is not running in the time the broadcast is triggered ?

    If the BroadcastReceiver is registered via a <receiver> element in the manifest, then yes.

    If the BroadcastReceiver is registered via registerReceiver(), called on some Context, then no.