Пример #1
0
		protected override void OnResume ()
		{
			try
			{
				base.OnResume ();
				if (acceptableLocationProviders.Count != 0) 
				{
					string Provider = acceptableLocationProviders.First ();

					if (_locationManager.IsProviderEnabled (Provider)) 
					{
						_locationManager.RequestLocationUpdates (Provider, 2000, 0, this);
						Coords thisCoords = new Coords (_locationManager.GetLastKnownLocation (Provider).Longitude.ToString (), _locationManager.GetLastKnownLocation (Provider).Latitude.ToString ());
						Global.GPSCoords = thisCoords;

					}
				}
			}
			catch(Exception ex) 
			{
				
			}

		}
Пример #2
0
		public void OnLocationChanged (Location location)
		{
			try
			{
				string Provider = acceptableLocationProviders.First();
				Coords thisCoords = new Coords (_locationManager.GetLastKnownLocation(Provider).Longitude.ToString(),_locationManager.GetLastKnownLocation(Provider).Latitude.ToString());
				Global.GPSCoords = thisCoords;
			}
			catch(Exception ex) 
			{
			}
			}