Here you can find the source of registAlarm(Context context, Class> target, int code, long time, HashMap
public static void registAlarm(Context context, Class<?> target, int code, long time, HashMap<String, Object> data)
//package com.java2s; import java.util.HashMap; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; public class Main { public static void registAlarm(Context context, Class<?> target, int code, long time, HashMap<String, Object> data) { Intent intent = new Intent(context, target); for (String key : data.keySet()) { intent.removeExtra(key);/*from www. j a v a2s . c o m*/ intent.putExtra(key, String.valueOf(data.get(key))); } PendingIntent sender = PendingIntent.getBroadcast(context, code, intent, PendingIntent.FLAG_UPDATE_CURRENT); AlarmManager manager = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); manager.set(AlarmManager.RTC_WAKEUP, time, sender); } }