Here you can find the source of setAlarm(Context context, Calendar calendar, PendingIntent pIntent)
private static void setAlarm(Context context, Calendar calendar, PendingIntent pIntent)
//package com.java2s; import java.util.Calendar; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.util.Log; public class Main { private static final String TAG = "com.example.lightwake.AlarmManagerHelper"; private static void setAlarm(Context context, Calendar calendar, PendingIntent pIntent) {//from ww w .j a v a 2s . co m Log.i(TAG, "setAlarm"); AlarmManager alarmManager = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pIntent); } }