As shown in the code below, when you press (Start) (GPSStart_Clicked) or end (GPSStop_Clicked), you may not receive, or the reception may not end.
private void GPSStart_Clicked(Object sender, EventArgs e) { _ = StartListening(); } private void GPSStop_Clicked(Object sender, EventArgs e) { _ = StopListening(); } public async Task StartListening() { if (CrossGeolocator.Current.IsListening) return; await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(1000), 1, false); CrossGeolocator.Current.PositionChanged += PositionChanged; } public async Task StopListening() { if (!CrossGeolocator.Current.IsListening) return; await CrossGeolocator.Current.StopListeningAsync(); CrossGeolocator.Current.PositionChanged -= PositionChanged; } private void PositionChanged(object sender, PositionEventArgs e) { ~~~~~~~~~~~~~~~~~~~~ }
Answers
Try to add more settings like:
Moreover, please notice that the event won't be triggered if the position isn't updated. This depends on the accuracy you set above. So it could happen that the event isn't called after listening.