Android examples for Android OS:Alarm Information
schedule Notification via Alarm
import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; public class Main{ public static void scheduleNotification(Context context, NextRemind remind) {/*from ww w. ja v a 2 s .co m*/ Intent i = new Intent(context, NotificationPublisher.class); i.putExtra(NotificationPublisher.EXTRA_REMIND, remind); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 1337, i, PendingIntent.FLAG_UPDATE_CURRENT); AlarmManager alarmManager = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); alarmManager.set(AlarmManager.RTC_WAKEUP, remind.timestamp, pendingIntent); } }