Back to project page Task-Reminder-App.
The source code is released under:
MIT License
If you think the Android project Task-Reminder-App listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.TechSect.TaskReminderApp; /* ww w .j a v a 2s . c o m*/ import java.util.Calendar; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; public class ReminderManager { private Context mContext; private AlarmManager mAlarmManager; public ReminderManager(Context context) { mContext = context; mAlarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE); } public void setReminder(Long taskId, Calendar when) { Intent i = new Intent(mContext, OnAlarmReceiver.class); i.putExtra(RemindersDbAdapter.KEY_ROWID, (long)taskId); PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, i, PendingIntent.FLAG_ONE_SHOT); mAlarmManager.set(AlarmManager.RTC_WAKEUP, when.getTimeInMillis(), pi); } }