title: How can we check that if alarm is exist / created in our Android phone / my app or not
body: <p>I've built one small reminder app demo. Now the problem is sometimes reminder coming or sometimes not? Now, I have this feature that user can set the alarm for day, month, week, year.</p>
  
  <p>Now how can I check for the month or year that notification is coming or not?</p>
  
  <p>Obviously, when I manually go and change the Android date and time settings, alarm not coming. (Even for some minutes also)</p>
  
  <p>See: <a href="https://stackoverflow.com/questions/55413304/when-i-change-android-phone-date-and-time-notification-not-getting-otherwise">When I change Android phone date and time, notification not getting, otherwise, if I do nothing, I get notification on time</a></p>
  
  <p><strong>Edit:
  Code:</strong></p>
  
  <pre><code>public void setRepeatAlarm(Context context, Calendar calendar, int ID, long RepeatTime, int requestCode) {
          mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
  
          // Put Reminder ID in Intent Extra
          Intent intent = new Intent(context, AlarmReceiver.class);
          intent.putExtra(REMINDER_ID, Integer.toString(ID));
  
  
          mPendingIntent = PendingIntent.getBroadcast(context, ID, intent, PendingIntent.FLAG_CANCEL_CURRENT);
          mPendingIntent = PendingIntent.getBroadcast(context, requestCode, new Intent(context, AlarmReceiver.class),
                  PendingIntent.FLAG_NO_CREATE);
           isAlarmSet = (mPendingIntent != null);
           if (isAlarmSet) {
               showLog("isAlarmSet: " + isAlarmSet);
           } else {
               showLog("isAlarmSet: " + isAlarmSet);
           }
          // Calculate notification timein
          Calendar c = Calendar.getInstance();
          long currentTime = c.getTimeInMillis();
          long diffTime = calendar.getTimeInMillis() - currentTime;
  
          // Start alarm using initial notification time and repeat interval time
          mAlarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME,
                  SystemClock.elapsedRealtime() + diffTime,
                  RepeatTime, mPendingIntent);
  
          // Restart alarm if device is rebooted
          ComponentName receiver = new ComponentName(context, BootReceiver.class);
          PackageManager pm = context.getPackageManager();
          pm.setComponentEnabledSetting(receiver,
                  PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
                  PackageManager.DONT_KILL_APP);
      }
  </code></pre>