Here you can find the source of setAlarm(Context context, Calendar calendar, PendingIntent pIntent)
@SuppressLint("NewApi") public static void setAlarm(Context context, Calendar calendar, PendingIntent pIntent)
//package com.java2s; import java.util.Calendar; import android.annotation.SuppressLint; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; public class Main { @SuppressLint("NewApi") public static void setAlarm(Context context, Calendar calendar, PendingIntent pIntent) {//from w w w . j a va 2 s . c o m AlarmManager alarmManager = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pIntent); } }