i want to create broadcast AlarmManager(repeating) with Notification message.i pass my calender object from Pickers. If i don't reboot my device it works normally. However, when i reboot my device,as you know my calander object will be null. How can i manage my repeating alarm after rebooting and how can i hold my Calendar schedules? Thanks for your ideas.
public class MyReceiver extends BroadcastReceiver {
private static final int PERIOD = 10000;
final public static String ALARM_ID = "AlarmId";
final public static String NOTIFICATION_ID = "NotificationId";
@Override
public void onReceive(Context ctxt, Intent i) {
}
static void scheduleAlarms(Context ctxt,Calendar c) {
AlarmManager alarManager = (AlarmManager) ctxt
.getSystemService(Context.ALARM_SERVICE);
//notification servise
Intent i = new Intent(ctxt, ScheduledService.class);
i.putExtra(ALARM_ID, 1);
i.putExtra(NOTIFICATION_ID, 1);
PendingIntent pi = PendingIntent.getService(ctxt, 0, i,
PendingIntent.FLAG_UPDATE_CURRENT);
alarManager.setRepeating(AlarmManager.RTC,c.getTimeInMillis(),PERIOD, pi);
}