title: Notification at specific time
body: <p>I have a notification at a specific time, see my code:</p>
  
  <pre><code>//Create alarm manager
   AlarmManager alarmMgr0 = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
  
   //Create pending intent &amp; register it to your alarm notifier class
   Intent intent0 = new Intent(this, AlarmReceiver_maandag_1e.class);
   intent0.putExtra("uur", "1e"); 
   PendingIntent pendingIntent0 = PendingIntent.getBroadcast(this, 0, intent0, 0);
  
   //set timer you want alarm to work (here I have set it to 8.30)
   Calendar timeOff9 = Calendar.getInstance();
   timeOff9.set(Calendar.HOUR_OF_DAY, 8);
   timeOff9.set(Calendar.MINUTE, 30);
   timeOff9.set(Calendar.SECOND, 0);
  
   //set that timer as a RTC Wakeup to alarm manager object
   alarmMgr0.set(AlarmManager.RTC_WAKEUP, timeOff9.getTimeInMillis(), pendingIntent0);
  </code></pre>
  
  <p>This works perfect except one thing.</p>
  
  <p>The notification is set for 8:30 with an alarm manager
  If I launch the app after 8:30, 9:00 for example, the notification still shows..</p>
  
  <p>Is there a possibility that the alarm goes off at 8:30 but not later?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>For anyone having the same problem, here is the solution:</p>
  
  <p>Put this in your broadcastreceiver:</p>
  
  <pre><code>long current_time = System.currentTimeMillis();
  
  Calendar timeOff9 = Calendar.getInstance();
  timeOff9.set(Calendar.HOUR_OF_DAY, 8);
  timeOff9.set(Calendar.MINUTE, 35);
  timeOff9.set(Calendar.SECOND, 0);
  
  long limit_time = timeOff9.getTimeInMillis();
  
  if (current_time &gt; limit_time) {
      //nothing
  } else {
      //show notification
  }
  </code></pre>