-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only Updating very occasionally, despite update interval being set to 500 #41
Comments
Thanks! Do you have these two implemented? @Override
protected void onResume() {
super.onResume();
// make the device update its location
location.beginUpdates();
// ...
}
@Override
protected void onPause() {
// stop location updates (saves battery)
location.endUpdates();
// ...
super.onPause();
} And, instead of the loop, could you try the following? location.setListener(new SimpleLocation.Listener() {
public void onPositionChanged() {
// new location data has been received and can be accessed
}
}); |
Hi, thanks for the help. For reference, this is my current code now:
Am I maybe implementing the new simplelocation in the wrong place? |
Heyo, I'm having an issue where the GPS location is only being updated very occasionally, despite the fact that I have explicitly defined it as 0.5s (500ms).
My Code:
I'd expect it to output a different value every time it loops (as it should have updated at least twice by then) but it never seems to. It only prints the same value over and over again, however, it is a valid value. I have tried this both in my house, running, as well as in a car, with the same results. It seems if I leave it for a bit, then open the app, it's happy to grab my location, but doesn't update it as I move...
I'm testing it on an OPPO Reno Z (CPH1979) on ColorOS 11.1, and I've confirmed the app has all of the permissions granted, and have tried with both Course and fine, and both with requireNew=true and false.
Many thanks,
GhostDog98
The text was updated successfully, but these errors were encountered: