-1

I'm setting an alarm like this:

mgr.setRepeating(AlarmManager.ELAPSED_REALTIME,SystemClock.elapsedRealtime() + PERIOD,PERIOD, pi);

Is there a way to get alarm manager running or not.

Harshit Rathi
  • 1,862
  • 2
  • 18
  • 25

1 Answers1

0

You can check if your pending intent triggered is running or not using the following code .

Intent checkIntent = new Intent(getApplicationContext(),MyScheduledReceiver.class);
alarmUp = (PendingIntent.getBroadcast(getBaseContext(), 0, checkIntent, PendingIntent.FLAG_NO_CREATE) != null);

Useful Links:

How to check if Pending intent triggered by AlarmManager setRepeating is already running?

How to check if Alarm have been set and running

How to check if AlarmManager already has an alarm set?

Community
  • 1
  • 1
Rachita Nanda
  • 4,509
  • 9
  • 42
  • 66