Android Delphi location sensor does not work if placement is allowed after application launch

I have an interesting problem with TLocationSensor . If there is a location in the android menu before starting my application, the sensor works fine. I caught the OnLocationChange event . But if I don’t allow “Location in the Android menu” and start the application, then allow the location in the Android menu sensor does not start!

The OnLocationChange event is not raised.

Set LocationSensor1.Active: = true; will not help in this case.

Or how can I automatically resolve the location after starting my application?

I am using Delphi XE10.1 Berlin and Android 6.0

+5
source share
1 answer

I have the same problem and solved it by changing application permission settings → installed application → select application → application permissions and set the location to.

0
source

Source: https://habr.com/ru/post/1656459/


All Articles