title: Android: Sending user a notification 7 days before a certain date.
body: <p>I am trying to create an app that sends an android notification 7 days before a specified date. Right now, I am reading in the right date and setting the calendar correctly, but for some reason, the alarm is not triggering. Additionally, when I do <code>adb shell dumpsys alarm</code> to see if the alarm is set, the dump does not display any alarms related to my app. My code that creates the AlarmManager and notification right now is </p>
  
  <pre><code>calendar.set(year, month, day, hour, min);
  calendar.add(Calendar.DAY_OF_MONTH, -7);
  AlarmManager alarmManager = (AlarmManager) context.getSystemService(ALARM_SERVICE);
  Intent intent = new Intent("android.media.action.DISPLAY_NOTIFICATION");
  PendingIntent broadcast = PendingIntent.getBroadcast(context, 100, intent, PendingIntent.FLAG_UPDATE_CURRENT);
  alarmManager.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), broadcast);
  </code></pre>
  
  <p>What could be going wrong with this? Is this not the correct way to set an alarm? I got the idea from <a href="https://stackoverflow.com/questions/28017943/android-how-to-set-a-notification-to-a-specific-date-in-the-future">here</a></p>