Skip to content
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

Fix: Showing Settings dialog multiple times #117

Merged
merged 1 commit into from
Jan 3, 2021

Conversation

yayaa
Copy link
Owner

@yayaa yayaa commented Jan 3, 2021

Follow up on: #107
Fixes: #115

// not getSourceProvider, because we don't want to connect if it is not already attempt
if (!settingsDialogIsOn && googlePlayServicesLocationSource != null &&
(isWaiting() || getConfiguration().keepTracking())) {
onConnected();
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onResume was used to keep the GoogleClient connection on, but since now that is taken care of by FusedLocationProviderClient directly, responsibility here is changed to request a location update so that is guaranteed that location provider client will be connected to this listener.

Requesting a location update multiple times will only replace the existing request, so it is safe to use it for keeping connection here. Any other action onResume can cause multiple calls. For example; Calling LocationManager.getLocation in Activity.onCreate will trigger get call and after onCreate, onResume will be triggered by the system. So, that is why, onResume should only re-attach listeners or re-connect clients nothing more.

@yayaa yayaa merged commit 23a3001 into master Jan 3, 2021
@yayaa yayaa deleted the yb/bug_fix_showing_dialog_multiple_times branch January 3, 2021 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate system dialog to enable GPS
1 participant