added in version 26.1.0
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1

AlarmManagerCompat

public final class AlarmManagerCompat
extends Object

java.lang.Object
   ↳ android.support.v4.app.AlarmManagerCompat


Compatibility library for AlarmManager with fallbacks for older platforms.

Summary

Public methods

static void setAlarmClock(AlarmManager alarmManager, long triggerTime, PendingIntent showIntent, PendingIntent operation)

Schedule an alarm that represents an alarm clock.

static void setAndAllowWhileIdle(AlarmManager alarmManager, int type, long triggerAtMillis, PendingIntent operation)

Like set(int, long, PendingIntent), but this alarm will be allowed to execute even when the system is in low-power idle modes.

static void setExact(AlarmManager alarmManager, int type, long triggerAtMillis, PendingIntent operation)

Schedule an alarm to be delivered precisely at the stated time.

static void setExactAndAllowWhileIdle(AlarmManager alarmManager, int type, long triggerAtMillis, PendingIntent operation)

Like setExact(AlarmManager, int, long, PendingIntent), but this alarm will be allowed to execute even when the system is in low-power idle modes.

Inherited methods

From class java.lang.Object

Public methods

setAlarmClock

added in version 26.1.0
void setAlarmClock (AlarmManager alarmManager,
                long triggerTime, 
                PendingIntent showIntent,
                PendingIntent operation)

Schedule an alarm that represents an alarm clock. The system may choose to display information about this alarm to the user.

This method is like setExact(AlarmManager, int, long, PendingIntent), but implies RTC_WAKEUP.

Parameters
alarmManager AlarmManager: AlarmManager instance used to set the alarm

triggerTime long: time at which the underlying alarm is triggered in wall time milliseconds since the epoch

showIntent PendingIntent: an intent that can be used to show or edit details of the alarm clock.

operation PendingIntent: Action to perform when the alarm goes off; typically comes from IntentSender.getBroadcast().

setAndAllowWhileIdle

added in