Пример #1
0
 private void UnregisterService()
 {
     if (_gpsServiceConnection != null)
     {
         _gpsServiceConnection.StopLocationService();
         UnbindService(_gpsServiceConnection);
         _gpsServiceConnection = null;
         _gpsServiceIntent.Dispose();
     }
 }
Пример #2
0
 private void RegisterService()
 {
     _gpsServiceConnection = new GpsServiceConnection();
     _gpsServiceIntent     = new Intent(Application.Context, typeof(GpsService));
     BindService(_gpsServiceIntent, _gpsServiceConnection, Bind.AutoCreate);
 }