/*************************
* Local service binding *
*************************/
private final IBinder binder = new WorkerServiceBinder();
/**
* Returns an instance of this service so binding components can directly call public methods of this service.
*/
public class WorkerServiceBinder extends Binder {
WorkerService getService() {
return WorkerService.this;
}
}
@Override
public IBinder onBind(Intent intent) {
String startedBy = intent.getStringExtra(STARTED_BY);
Log.i(TAG, "Was bound to by: " + startedBy);
// allow binding to this local service directly so anyone can call public functions on this service directly
return binder;
}