title: onReceiver of BroadcastReceiver not called, AlarmManager
body: <p>I am building a cab booking app, I need current location of the cab every 20 seconds.</p>
  
  <p>I have defined a AlarmManager and need it to repeat itself every 20 seconds. But its not repeating itself regularly. Instead it repeated itself after 233 seconds, and just once. What am I doing wrong here ?</p>
  
  <p>My HomeScreen has a inner class OnAlarmReceiver, in the onCreate of my HomeScreen I am calling AlarmManager</p>
  
  <pre><code>    AlarmManager mgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
      Intent i = new Intent(this, OnAlarmReceiver.class);
      i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      PendingIntent pi = PendingIntent.getBroadcast(this, 0, i, PendingIntent.FLAG_CANCEL_CURRENT);
      Calendar cal = Calendar.getInstance();
      cal.add(Calendar.SECOND, 20);
      mgr.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
              cal.getTimeInMillis(), God.UPDATE_PENDING_INTERVAL, pi);
  </code></pre>
  
  <p>Inner class in HomeScreen</p>
  
  <pre><code>public class OnAlarmReceiver extends BroadcastReceiver {
      @Override
      public void onReceive(Context context, Intent intent) {
          // PullPendingRequests.acquireStaticLock(context);
          Toast.makeText(context, "Don't panik but your time is up!!!!.", Toast.LENGTH_LONG)
                  .show();
          Log.d("Taxeeta:PullPendingRequets", "CallService Location");
          context.startService(new Intent(context, PullPendingRequests.class));
      }
  }
  </code></pre>
  
  <p>My AndroidManifest file has</p>
  
  <pre><code>    &lt;service
          android:name="com.taxeeta.support.PullPendingRequests"
          android:enabled="true"
          android:label="@string/app_name"
          android:screenOrientation="portrait"
          android:theme="@android:style/Theme.Light.NoTitleBar" /&gt;
  
      &lt;receiver android:name=".com.taxeeta.HomeScreen.OnAlarmReceiver" /&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>Output of <code>adb shell dumpsys alarm</code></p>
  
  <pre><code> com.taxeeta
      51471ms running, 5248 wakeups
      5248 alarms: flg=0x4 cmp=com.taxeeta/.HomeScreen$OnAlarmReceiver
  </code></pre>
  
  <p>Output of <code>adb shell dumpsys alarm | grep taxeeta</code></p>
  
  <pre><code> ELAPSED_WAKEUP #7: Alarm{409303b0 type 2 com.taxeeta}
      operation=PendingIntent{408ba2d8: PendingIntentRecord{40887be8 com.taxeeta broadcastIntent}}
   com.taxeeta
      5248 alarms: flg=0x4 cmp=com.taxeeta/.HomeScreen$OnAlarmReceiver
  </code></pre>