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