private async void MAdapterOnItemClick(object sender, PlacesAdapterClickEventArgs e)
        {
            try
            {
                var item = MAdapter.GetItem(e.Position);
                if (item != null)
                {
                    Intent intent = new Intent();
                    intent.PutExtra("Address", item.Address);
                    if (item.LatLng != null)
                    {
                        intent.PutExtra("latLng", item.LatLng.Latitude + "," + item.LatLng.Longitude);
                    }
                    else
                    {
                        var latLng = await GetLocationFromAddress(item.Address);

                        if (latLng != null)
                        {
                            intent.PutExtra("latLng", latLng.Latitude + "," + latLng.Longitude);
                        }
                    }
                    SetResult(Result.Ok, intent);
                    Finish();
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Esempio n. 2
0
 private void MAdapterOnItemClick(object sender, PlacesAdapterClickEventArgs e)
 {
     try
     {
         var item = MAdapter.GetItem(e.Position);
         if (item != null)
         {
             Intent intent = new Intent();
             intent.PutExtra("Address", item.Address);
             intent.PutExtra("latLng", item.LatLng.Latitude + "," + item.LatLng.Longitude);
             SetResult(Result.Ok, intent);
             Finish();
         }
     }
     catch (Exception exception)
     {
         Methods.DisplayReportResultTrack(exception);
     }
 }