public ServiceConnection(LocationBinder binder) { if (binder != null) { this._binder = binder; } }
public void OnServiceConnected(ComponentName name, IBinder service) { LocationBinder serviceBinder = service as LocationBinder; if (serviceBinder != null) { this._binder = serviceBinder; this._binder.IsBound = true; Console.WriteLine(nameof(OnServiceConnected) + " OnService Connected"); // Notify, service connected event this.ServiceConnected(this, new ServiceConnectedEventArgs() { Binder = service }); //Service is bound, we can start gathering location. serviceBinder.Service.BroadCastLocation(); } }