Here you can find the source of setRepeatingAlarm(Context context, Intent intentBroadcast, long time, long interval)
public static void setRepeatingAlarm(Context context, Intent intentBroadcast, long time, long interval)
//package com.java2s; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import java.util.Calendar; public class Main { public static final String SET_ALARM = "com.kit.set_alarm"; public static void setRepeatingAlarm(Context context, Intent intentBroadcast, int hour, int minute, int second, int millisecond, long interval) { AlarmManager alarm = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, hour); calendar.set(Calendar.MINUTE, minute); calendar.set(Calendar.SECOND, second); calendar.set(Calendar.MILLISECOND, millisecond); intentBroadcast.setAction(SET_ALARM); PendingIntent sender = PendingIntent.getBroadcast(context, 0, intentBroadcast, PendingIntent.FLAG_UPDATE_CURRENT); alarm.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), interval, sender);//set the properties of alarm }//from w ww.j a v a2 s . c o m public static void setRepeatingAlarm(Context context, Intent intentBroadcast, long time, long interval) { AlarmManager am = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intentBroadcast, PendingIntent.FLAG_UPDATE_CURRENT); am.setRepeating(AlarmManager.RTC_WAKEUP, time, interval, pendingIntent); } public static void setRepeatingAlarm(Context context, PendingIntent pendingIntent, long time, long interval) { AlarmManager am = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); am.setRepeating(AlarmManager.RTC_WAKEUP, time, interval, pendingIntent); } }