Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

location address update without press button

$
0
0

here my sample

` async void getADress() { try {

    if (_currentLocation == null)
      {
        _addressText.Text = "Can't determine the current address.";
        return;
      }

    Geocoder geocoder = new Geocoder(this);
    IList<Address> addressList = await geocoder.GetFromLocationAsync(_currentLocation.Latitude, _currentLocation.Longitude, 10);



    Address address = addressList.FirstOrDefault();
    if (address != null)
      {
        StringBuilder deviceAddress = new StringBuilder();
        for (int i = 0; i < address.MaxAddressLineIndex; i++)
          {
            deviceAddress.Append(address.GetAddressLine(i))
              .AppendLine(",");
          }
        _addressText.Text = deviceAddress.ToString();
      }
    else
      {
        _addressText.Text = "Unable to determine the address.";
      }


      } catch(Exception ex)
      {

      }

      finally {}


  }`

is there a solution without 1 or 5 sec threading?

i get gps coordinates but i tried async

example;

on start says coulndt locate, when locates automaticly update?

thanks


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>