Setting an alarm at a particular time and having it call a broadcast receiver.Once the broadcast receiver is invoked, we can use the information to perform both simple and long-running operations in that broadcast receiver.
The steps are as follows :
The steps are as follows :
- Get access to the alarm manager.
- Come up with a time to set the alarm.
- Create a receiver to be invoked.
- Create a pending intent that can be passed to the alarm manager to invoke the receiver at the appointed time.
- Use the time instance from step 2 and the pending intent from step 4 to set the alarm.
- See the receiver from step 3 invoked.
No comments:
Post a Comment