Android Alarm Create setExact(AlarmManager alarmManger, int type, long triggerAtMillis, PendingIntent operation)

Here you can find the source of setExact(AlarmManager alarmManger, int type, long triggerAtMillis, PendingIntent operation)

Description

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

License

Open Source License

Parameter

Parameter Description
alarmManger a parameter
type a parameter
triggerAtMillis a parameter
operation a parameter

Declaration

@SuppressLint("NewApi")
public static void setExact(AlarmManager alarmManger, int type,
        long triggerAtMillis, PendingIntent operation) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import android.annotation.SuppressLint;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.os.Build;

public class Main {

    @SuppressLint("NewApi")
    public static void setExact(AlarmManager alarmManger, int type,
            long triggerAtMillis, PendingIntent operation) {
        if (Build.VERSION.SDK_INT >= 19) {
            alarmManger.setExact(type, triggerAtMillis, operation);
        } else {// w  ww. j  a v a  2 s. co m
            alarmManger.set(type, triggerAtMillis, operation);
        }
    }
}

Related

  1. setAlarm(Context context, Calendar calendar, PendingIntent pIntent)
  2. setPendingAndroidAlarm(Context context, Calendar calendar, PendingIntent pIntent)
  3. setAlarm(Context context, Calendar calendar, PendingIntent pIntent)
  4. setupAlarmManager(Context context, long minutesInMillis, PendingIntent pendingIntent)
  5. setExact(AlarmManager alarmManger, int type, long triggerAtMillis, PendingIntent operation)
  6. setAlarm(Context context, Calendar calendar, PendingIntent pIntent)
  7. setBoolean(ContentValues alarm, String key, boolean value)
  8. setRepeatingAlarm(Context context, Intent intentBroadcast, int hour, int minute, int second, int millisecond, long interval)
  9. setRepeatingAlarm(Context context, Intent intentBroadcast, long time, long interval)