I have access fine and coarse location checked in the manifest file and first time the application runs on the android emulator (Android_Accelerated_x86 (Android 7.1 - API 25)) it logs the latitude. But if I deploy the app for the second time, third time and so on it runs endlessly even though the timeout is 10000 ms (no Exception thrown). If I close and open the emulator and deploy the app again it works again and so on. Any ideas on how to fix this?
public static class NetworkingTools
{
private static IGeolocator locator = Resolver.Resolve<IGeolocator>();
static NetworkingTools()
{
locator.DesiredAccuracy = 50;
locator.StartListening(2000, 0, true);
GetPosition();
}
public async static void GetPosition()
{
var position = await locator.GetPositionAsync(10000);
System.Diagnostics.Debug.WriteLine(position.Latitude);
}
}