Now that we know how to schedule alarms, let's take a look at what we can schedule with them.
Essentially, we can schedule anything that can be started with a
PendingIntent, which means we can use alarms to start Activities, Services, and BroadcastReceivers. To specify the target of our alarm, we need to use the static factory methods of
PendingIntent.getActivities(…) PendingIntent.getActivity(…) PendingIntent.getService(…) PendingIntent.getBroadcast(…)
In the following sections, we'll see how each type of
PendingIntent can be used with
Activity from an alarm is as simple as registering the alarm with a
PendingIntent created by invoking the static