That's odd... the cancel really should work.  You need an intent that is 
identical to the one you are trying to cancel. It looks as if that's what 
you've got.  Is it possible that you've scheduled multiple but slightly 
different alarms, while developing?

Uninstalling the app that scheduled the alarm should get rid of it.

G. Blake Meike
Marakana

Programming Android 2ed is now in stores:
http://bit.ly/programmingandroid


On Sunday, December 30, 2012 11:51:06 AM UTC-8, Giuseppe wrote:
>
> I have created a PendingIntent with AlarmManager that send an email every 
> minute with following code:
>
> public void SetAlarm(Context context) {
> AlarmManager am = (AlarmManager) 
> context.getSystemService(Context.ALARM_SERVICE);
> Intent i = new Intent(context, Backup_Email_Receiver.class);
> PendingIntent pi = PendingIntent.getBroadcast(context, 0, i, 0);
> am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 1000 
> * 60 * 1, pi); 
> }
>
> and now I am trying to remove it using:
>
> public void CancelAlarm(Context context) {
> Intent intent = new Intent(context, Backup_Email_Receiver.class);
> PendingIntent sender = PendingIntent.getBroadcast(context, 0, intent, 0);
> AlarmManager alarmManager = (AlarmManager) 
> context.getSystemService(Context.ALARM_SERVICE);
> alarmManager.cancel(sender);
> }
>
> But there is no way to delete it !!!!
> I am getting crazy as I have tried in any way, please any help before I 
> wipe the device ?
>
> Also I have create this Pending Intent in different situation, like a Unit 
> Test and from a service, and I have already tried to delete it using the 
> same system, but no way.
>
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to