title: Check if an alarm manager is running (not working correctly)
body: <p>first I did read other questions similar to this one, the one that seemed most helpful is this <a href="https://stackoverflow.com/questions/4556670/how-to-check-if-alarmmanager-already-has-an-alarm-set">one</a>, and tried using the top two answers to fix my issue, I have two alarm managers in main activity as shown here</p>
  
  <pre><code>private static final int NOTIFICATION_REMINDER_PROMPT = 0;
  private static final int NOTIFICATION_REMINDER_UPDATE = 1;
  
  if(!alarmIsRunning(this, new Intent(this, PromptReceiver.class))) {
  
      Intent notifyIntent = new Intent(this, PromptReceiver.class);
      PendingIntent pendingIntent = PendingIntent.getBroadcast
              (this, NOTIFICATION_REMINDER_PROMPT, notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT);
      AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
      alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(),
              1000 * 60 * 60, pendingIntent);
  
  }
  
  if(!alarmIsRunning(this, new Intent(this, UpdateReceiver.class))) {
      Intent notifyIntent2 = new Intent(this, UpdateReceiver.class);
      PendingIntent pendingIntent2 = PendingIntent.getBroadcast
              (this, NOTIFICATION_REMINDER_UPDATE, notifyIntent2, PendingIntent.FLAG_UPDATE_CURRENT);
      AlarmManager alarmManager2 = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
      alarmManager2.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(),
              1000 * 60 * 60 * 50, pendingIntent2);
  }
  </code></pre>
  
  <p>also the code for function that is used in the if function is as follows</p>
  
  <pre><code>public static boolean alarmIsRunning(Context context, Intent intent){
      return PendingIntent.getBroadcast(context, 0,
              intent, PendingIntent.FLAG_NO_CREATE) != null;
  }
  </code></pre>
  
  <p>Now my issue is that when I debug, the first if condition always gives true, and the second always gives false and runs the code inside, but when I went for the second way which is using the <code>adb shell dumpsys alarm</code> line in my terminal, only the second one is working. There is something that seems to be I don't understand about this.</p>