2011-06-07 79 views
0

我有一个已知的ID提醒,但无法找到一个解决方案来删除它...我已经加入通知是这样的:http://developer.android.com/guide/topics/ui/notifiers/notifications.html与AlarmManager ...ANDROID删除提醒

我认为,解决方案应是这样的:

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); 

但有关于它的一些想法......因为设置命令是:

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

所以基本上我已存储requestCode ......比我相信我应该能够删除与此requestCode报警...

请告诉我在这个问题...我真的不知道如何解决它...谢谢!

+0

可能重复[如何取消重复报警?](http://stackoverflow.com/questions/3330522/how-to-cancel-this-repeating-alarm) – rds 2013-02-21 16:29:12

回答

1

使用报警管理器的cancel功能。

这里有更多Help