/// <summary> /// Initializes a new instance of the <see cref="T:LocationTest.Droid.BackgroudServices.GPSServiceConnection"/> class. /// </summary> /// <param name="binder">Binder.</param> public GPSServiceConnection(GPSServiceBinder binder) { if (binder != null) { this._binder = binder; } }
/// <summary> /// Ons the service connected. /// </summary> /// <param name="name">Name.</param> /// <param name="service">Service.</param> public void OnServiceConnected(ComponentName name, IBinder service) { GPSServiceBinder serviceBinder = (GPSServiceBinder)service; if (serviceBinder != null) { this._binder = serviceBinder; this._binder.IsBound = true; serviceBinder.Service.StartLocationUpdates(); if (Connected != null) { Connected.Invoke(); } } }