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.
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.
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?