Starting Service from BroadcastReceiver
should be like that:
Intent i = new Intent(context, YourServiceName.class);
context.startService(i);
be sure to add the service to manifest.xml
use the context
from the onReceive
method of your BroadcastReceiver to start your service component.
@Override
public void onReceive(Context context, Intent intent) {
Intent serviceIntent = new Intent(context, YourService.class);
context.startService(serviceIntent);
}
Don't forget
context.startService(..);