public TaskConnection(TaskBinder binder, AppTask task) { if (binder != null) { this._Binder = binder; } this.Task = task; }
// 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) { // cast the binder located by the OS as our local binder subclass TaskBinder serviceBinder = service as TaskBinder; if (serviceBinder != null) { this._Binder = serviceBinder; this._Binder.IsBound = true; //this._Binder.JobEnded += JobEnded; Log.Debug ( "ServiceConnection", "OnServiceConnected Called" ); serviceBinder.Service.StartTask (this.Task); } }
// 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) { // cast the binder located by the OS as our local binder subclass TaskBinder serviceBinder = service as TaskBinder; if (serviceBinder != null) { this._Binder = serviceBinder; this._Binder.IsBound = true; //this._Binder.JobEnded += JobEnded; Log.Debug("ServiceConnection", "OnServiceConnected Called"); serviceBinder.Service.StartTask(this.Task); } }