private void UnregisterService() { if (_gpsServiceConnection != null) { _gpsServiceConnection.StopLocationService(); UnbindService(_gpsServiceConnection); _gpsServiceConnection = null; _gpsServiceIntent.Dispose(); } }
private void RegisterService() { _gpsServiceConnection = new GpsServiceConnection(); _gpsServiceIntent = new Intent(Application.Context, typeof(GpsService)); BindService(_gpsServiceIntent, _gpsServiceConnection, Bind.AutoCreate); }