Check if setAlarmClock AlarmManager is charged

The Lollipop API provides a method setAlarmClockfor paying for intent. for starters, I can use this code:

am.setAlarmClock(new AlarmManager.AlarmClockInfo(nexttime,pi), pi);

to cancel:

am.cancel(PendingIntent.getService(ctx, 0, intentS, 0));

but how to check if it was already charged?

In general, I can use this:

boolean alarmUp = (PendingIntent.getBroadcast(ctx, 0, intent, PendingIntent.FLAG_NO_CREATE) != null);

but what about this new method? Does it work correctly for setAlarmClockin a clean method set?

0
source share

All Articles