The You receiver stops working, because you construct it in onCreate, which means it will live as long as your app is alive. … If you want a background receiver, you need to register it inside the AndroidManifest (with intent filter), add an IntentService and start it when you receive a broadcast in the receiver. A broadcast receiver (receiver) is an Android component which allows you to register for system or application events. All registered receivers for an event are notified by the Android runtime once this event happens.Why we use broadcast receiver in android?
What Is Protected Broadcast in Android?
•
•
4 min read
Contents