开发者

ANDROID Remove reminder

I have reminder with a known ID, but couldn't find a solution to delete it... I have added Notification this way: http://developer.android.com/guide/topics/ui/notifiers/notifications.html and with AlarmManager...

I believe开发者_开发问答 that solution should be something like:

AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
Intent intentAlarm = new Intent(ShowEmission.this, CustomAlarm.class);
intentAlarm.putExtra...
...
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, .., intentAlarm, PendingIntent.FLAG_ONE_SHOT);
am.cancel(pendingIntent);

But have some thoughts about it ... since the command to set is:

PendingIntent pendingIntent = PendingIntent.getBroadcast(context, requestCode, intent, flags)

so basically I have requestCode stored... Than I believe I should be able to delete the alarm with this requestCode...

Please advise me on this problem... I really have no idea how to solve it... Thanks!


Use Alarm Manager's cancel function.

Here's more Help

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜