Why on Earth are you using setType() with random data? Delete the
setText() call -- use extras for passing data, please -- and your
problem should go away.

On Tue, Feb 14, 2012 at 10:16 AM, Rudolf Polzer <[email protected]> wrote:
> I use alarms and I use the type of the intent to carry some text.
> When the alarm time has changed, I try to cancel the old alarm, but
> this doesn't work:
>
>  AlarmManager am =
> (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
>  Intent in = new Intent(context, OnAlarmReceiver.class);
>  in.setType(text_of_last_alarm);
>  PendingIntent pi = PendingIntent.getBroadcast(context, 0, in, 0);
>  am.cancel(pi);
>
> This is how I am setting a new or changed alarm - this works:
>
>  in = new Intent(context, OnAlarmReceiver.class);
>  in.setType(text_of_new_alarm);
>  PendingIntent pi = PendingIntent.getBroadcast(context, 0, in, 0);
>  am.set(AlarmManager.RTC_WAKEUP, time, pi);
>  text_of_last_alarm = text_of_new_alarm;
>
> Any Ideas?
>
> --
> 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



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_ Version 2.4
Available!

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