title: Best way to trigger BroadcastReceiver
body: <p>In my mobile application. I need to trigger a BroadcastReceiver which will show some popup/system notification.</p>
  
  <p>Trigger time of this BroadcastReceiver</p>
  
  <ol>
  <li>Every day it should trigger at 13:00.</li>
  <li>After initial trigger at 13:00. It should trigger every 30 sec.</li>
  <li>It should stop triggering every 30 sec after 14:00.</li>
  </ol>
  
  <p>I tried the following way</p>
  
  <p><strong>Using 2 BroadcastReceiver's</strong></p>
  
  <p>BroacastReceiver 1 is called using AlaramManager</p>
  
  <pre><code>    Intent intent = new Intent("broadcast.receiver.one.action");
      PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0,
              intent, 0);
      AlarmManager manager = (AlarmManager) context
              .getSystemService(Context.ALARM_SERVICE);
      manager.setRepeating(AlarmManager.RTC_WAKEUP, oneAmCalenderObject.getTimeInMillis(),AlarmManager.INTERVAL_DAY, pendingIntent);
  </code></pre>
  
  <p>BroadcastReceiver 1 will start at 13:00 daily and contains a timer which will start BroacastReciever 2 every 30 sec.</p>
  
  <pre><code> timer.schedule(new TimerTask() {
          public void run() {
              if (isLessThanTwoPM()) {
                  callBroadcastReceiverTwo();
              } else {
                  timer.cancel();
              }
  
          }
      }, 0, 30 * (1000 * 1));
  </code></pre>
  
  <p>I would like to know, If there is any better way.</p>