title: How to check if Alarm have been set and running
body: <p>I have a receiver that start after phone boot like this: </p>
  
  <pre><code>&lt;receiver android:name=".OnBootReceiver" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
              &lt;/intent-filter&gt;
  
  &lt;/receiver&gt;
  </code></pre>
  
  <p>in the receiver I run set an alarm like this:</p>
  
  <pre><code>AlarmManager  mgr=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
  
          Intent i=new Intent(context, LocationPoller.class);
  
          i.putExtra(LocationPoller.EXTRA_INTENT,
                    new Intent(context, LocationReceiver.class));
          i.putExtra(LocationPoller.EXTRA_PROVIDER,
                   LocationManager.GPS_PROVIDER);
  
  
  
           PendingIntent pi=PendingIntent.getBroadcast(context, 0, i, 0);
            mgr.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                          SystemClock.elapsedRealtime(),
                          PERIOD,
                          pi);
  </code></pre>
  
  <p>It works fine, except, of course, when user install app, the alarm will not be set until user reboot phone,.</p>
  
  <p>to go around this, I need to check from my Activity if AlarmManager is set, if not I need to set from Activity.</p>
  
  <p>Hence, how do I check if Alarm manager is already set.</p>