Samuel Samuel - 3 months ago 8
Android Question

Starting Service from BroadcastReceiver

I have a Service and Broadcast Receiver in my application, but how do I launch the service directly from the Broadcast Receiver? using

startService(new Intent(this, MyService.class));


does not work in a broadcast receiver, any ideas?

Thanks!

EDIT:


context.startService(..);


works, I forgot the context part

Answer

dont forget

context.startService(..);