check if charged setAlarmClock of AlarmManager

江枫思渺然 提交于 2019-12-11 11:27:04

问题


The Lollipop API represents setAlarmClock method to charge an intent. to start in 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 whether it was already charged?

In common case I can use this:

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

but what about this new method? Does it works properly for setAlarmClock on pure set method?

来源:https://stackoverflow.com/questions/36110837/check-if-charged-setalarmclock-of-alarmmanager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!