broadcast receiver is a component that listens for and responds to system-wide broadcasts. In Android, a broadcast receiver is an object that implements the BroadcastReceiver class.
To create a broadcast receiver, we need to follow these steps:
- Create the class and make it extend the BroadcastReceiver class.
- Define a constructor with no arguments (empty parentheses).
- Implement the onReceive() method which will be called when there's an event of interest.
Share a personalized message with your friends.