title: Android AlarmManager & Notification
body: <p>I need the <code>AlarmManager</code> to push a notification at the same time everyday. When I first loaded the app, it worked as I expected. Unfortunately after I rebooted my phone, there's no notification at the time. If I open the app, the notification does show. What I need is to remind the user to use the app when they don't. If they have to enter the app for it to work, it's worthless.</p>
  
  <p>Here is some of my code:</p>
  
  <pre><code>AlarmManager am = getAlarmManager(ctx);
  Intent i = new Intent(ctx, UpdateReceiver.class);
  PendingIntent pendingIntent = PendingIntent.getBroadcast(ctx, 0, i, 0);
  Calendar cal = Calendar.getInstance();
  cal.setTime(new Date(System.currentTimeMillis()));
  //If current time is later than 22, the alarm time should set 22 in the next day
  if (cal.get(Calendar.HOUR_OF_DAY)&gt;22)
  {
      cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH)+1);
  }
  cal.set(Calendar.HOUR_OF_DAY, 22);
  cal.set(Calendar.MINUTE, 0);
  am.setRepeating(AlarmManager.RTC_WAKEUP ,cal.getTimeInMillis(), 24 * 60 * 60 * 1000, pendingIntent);
  </code></pre>
  
  <p>How can I get the app to always send the notifications correctly?</p>