I am trying to get current coordinates directly in Xamarin.Forms app in button click handler:
` LocationManager LocMgr = Android.App.Application.Context.GetSystemService("location") as LocationManager;
var locationCriteria = new Criteria();
locationCriteria.Accuracy = Accuracy.High;
locationCriteria.PowerRequirement = Power.High;
var locationProvider = LocMgr.GetBestProvider(locationCriteria, true);
var lastLocation = LocMgr.GetLastKnownLocation(locationProvider);
`
But it throws TimeoutException at locationCriteria.Accuracy = Accuracy.High. What am I doing wrong with my code and how to do this in a correct way?