Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Geocoder does not work from background thread in Windows Phone.

$
0
0

If I run:

var coder = new Geocoder();
var partnerPosition = (await coder.GetPositionsForAddressAsync(partner.Address)).FirstOrDefault();

I get a cross-thread execution exception. If I try to wrap the code in Device.BeginInvokeOnMainThread, it executes but returns no results. I can successfully call the above code in the constructor of a Page, and it executes correctly.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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