First authorization for LocationSensor in Firemonkey

  

I use a TLocationSensor component where Active=True is set to design mode (same effect in by coding).
When I use the app for the first time on Android I get the message to accept to be localised. If I answer with Yes I never enter in my LocationSensorLocationChanged event.
I close app, open it again and now it’s ok.
I test with this method :
procedure TfrmMain.LocationSensorLocationChanged(Sender: TObject; const OldLocation, NewLocation: TLocationCoord2D);
begin
if (NewLocation.Latitude > 0) and (NewLocation.Longitude > 0) then
begin
edGeocode.Text := NewLocation.Latitude.ToString + ‘-‘ + NewLocation.Longitude.ToString;
end;
end;

I’m using Firemonkey 10.4.1.

Comments are closed.