public OpenSesameServiceConnection(OpenSesameServiceBinder binder) { if (binder != null) { this.binder = binder; } }
// This gets called when a client tries to bind to the Service with an Intent and an // instance of the ServiceConnection. The system will locate a binder associated with the // running Service public void OnServiceConnected(ComponentName name, IBinder service) { OpenSesameServiceBinder serviceBinder = service as OpenSesameServiceBinder; if (serviceBinder != null) { this.binder = serviceBinder; this.binder.IsBound = true; Log.Debug("ServiceConnection", "OnServiceConnected Called"); this.ServiceConnected(this, new ServiceConnectedEventArgs() { Binder = service }); serviceBinder.Service.StartUpdates(); } }