Hi All, I just found my problem:

This is the way to use notification from broadcastReceivers:
NotificationManager mgr =
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);

Schedule alarms from BroadcastReceivers: AlarmManager am =
(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);

You have to use the context prefix always!

Hope this is useful!

Juan


On Sat, Nov 1, 2008 at 1:51 PM, Juan David Trujillo C. <
[EMAIL PROTECTED]> wrote:

> Hi guys!
> Does anyone know how I can create a notification and schedule an alarm
> from a BroadcastReceiver? Am I doing something wrong, cause when I try
> to use any of these, I get an error: final NotificationManager mgr =
> (NotificationManager)getSystemService(NOTIFICATION_SERVICE) or Intent
> i = new Intent(AlarmFired.class, ScheduleNextAlarm.class);
>
> Apparently those can only be used from classes that extend Activity,
> not classes that extend BroadcastReceiver.
>
> I really appreciate any help provided!
>
> Thanks,
>
> Juan




-- 
-------------------------------
Juan David Trujillo C.

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