I have a Service
and BroadcastReceiver
in my application, but how do I launch the service directly from the BroadcastReceiver
? Using
startService(new Intent(this, MyService.class));
does not work in a BroadcastReceiver
, any ideas?
EDIT:
context.startService(..);
works, I forgot the context part
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…