private void Service_LocationChanged(object sender, Android.Locations.LocationChangedEventArgs e) { var location = e.Location; latText.Text = location.Latitude.ToString(); lngText.Text = location.Longitude.ToString(); altText.Text = location.Altitude.ToString(); speedText.Text = location.Speed.ToString(); }
void OnLocationChanged(object sender, Android.Locations.LocationChangedEventArgs e) { Log.Debug(logTag, "OnLocationChanged - UI being updated."); var loc = e.Location; RunOnUiThread(() => { latText.Text = loc.Latitude.ToString(); lonText.Text = loc.Longitude.ToString(); altText.Text = loc.Altitude.ToString(); speedText.Text = loc.Speed.ToString(); accuracyText.Text = loc.Accuracy.ToString(); bearingText.Text = loc.Bearing.ToString(); }); }
void LocationChanged(object sender, Android.Locations.LocationChangedEventArgs e) { var location = e.Location; string s = "Latitude: " + location.Latitude.ToString() + System.Environment.NewLine + "Longitude: " + location.Longitude.ToString() + System.Environment.NewLine + "Altitude: " + location.Altitude.ToString() + System.Environment.NewLine + "Speed: " + location.Speed.ToString(); Message message = new Message(s, null, currentPerson.Id, true); //MainActivity.messages[currentPerson].Add(message); currentPersonMessages.Add(message); adapter.NotifyDataSetChanged(); recylerView.ScrollToPosition(currentPersonMessages.Count - 1); conn.Insert(message); UnbindService(lsConnection); }