title: Can I set an end time for AlarmManager in Android?
body: <p>I have set up an <code>AlarmManager</code> to go off at a specific time, and then repeat in intervals. Is it possible to tell it after how many intervals to stop? Or even at what time to stop?</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>    Calendar calendar = Calendar.getInstance();
      calendar.setTimeInMillis(System.currentTimeMillis());
      calendar.set(Calendar.HOUR_OF_DAY, 13);
      calendar.set(Calendar.MINUTE, 56);
      Intent intent = new Intent(this, MyService.class);
      alarmIntent = PendingIntent.getService(this, 0, intent, 0);
      alarmMgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
      alarmMgr.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
              1000 * 60 * 60, alarmIntent);
  </code></pre>
  
  <p>Also do I need to do anything to ensure it will go off every day? Or is it already doing that?</p>