My Application uses a service that is started by a BOOT_COMPLETE BroadcastReceiver, in run i\'m getting an error
my code:
public class projet extends Br
According to bindService documentation:
Note: this method can not be called from a BroadcastReceiver component. A pattern you can use to communicate from a BroadcastReceiver to a Service is to call startService(Intent) with the arguments containing the command to be sent, with the service calling its stopSelf(int) method when done executing that command.
What I did: (Not sure if it works in all cases) You can create a Service and start that service in your BroadcastReceiver. Inside your service onCreate() method, you can call a method from another class who is in charge of binding. You can pass the context from service to that class and use it like this: ctx.bindService(...)