Closed westnordost closed 7 years ago
Additional information: With earlier versions (except the ones that crashed), a location update was available practically immediately when tabbing out and then in.
(The revert is only for the stable v0.13. On master, LOST 3.0.2 is still used)
The reason the initial location request is not received is because state is not cleared in the class which handles sending location updates when the service is shutdown. So, an initial location is attempted to be sent but is not deemed "good enough" and is therefore ignored.
Thanks for the report, I'll post a fix shortly.
Description
After stopping location updates (through tabbing out / changing Activity) and disconnecting from LOST api client, when it is attempted to reconnect later and request location updates anew, onLocationChanged is never called.
Steps to Reproduce
For StreetComplete: Turn on location. Tab out or go to settings activity, then go back. The GPS button does not stop blinking (=app is waiting for a location update but does not get one).
Program flow:
MainActivity.onStart()
:locationRequestFragment.startRequest();
is called which ensures that the app has all the permissions and location is enabled. It then callsMainActivity.onLocationIsEnabled()
: The GPS button is made to blink.singleLocationRequest.startRequest
(source) connects to LOST, on connection requests location updates and then would, on receiving the first location update, make the GPS button stop blinking. The location update never comes.Edit: Now after 5-10 minutes, the location update was received.
Lost & Android Version
LOST 3.0.2