BroadcastReceiver when the application is not running

I have a BroadcastReceiverregistered in the manifest that receives notifications from AlarmManager. All this works fine while the application is running, that is, the method is called onReceive().

However, if I force-quit the application to check whether BroadcastReceiverit will receive notifications from AlarmManagerwhile it is not running, the method is onReceive()never called.

Can forced stops not be used for testing AlarmManagerand the receiver in this way? It seems that some answers say that this will not work, and some say that it should be.

If not, is there a way to test this?

+5
source share
2

, . .

. .

+3

, . , "".

+1

All Articles