location-samples
location-samples copied to clipboard
Infinity loop in showing snackbar, if deny permission with enabled checkbox "Don't ask again"
@anddever which sample has this problem? Can you provide some more information?
LocationUpdates, https://youtu.be/s67KFWppBj8
I can repro. I'll submit a fix shortly.
@shailen any solution to this issue?
Waiting for response
any solution?
I don't know why they are ignoring this annoying issue.
@shailen @codingjeremy @samtstern Can you take a look at this please? It is really easy to reproduce... just install the LocationUpdates, deny location permission, hit OK on the snackbar prompt, and then "Deny & don't ask again". It will go into the infinite loop.
My walk around is to move the part of checking permission from onResume() to onStart()
@Override
public void onStart() {
super.onStart();
// Within {@code onPause()}, we remove location updates. Here, we resume receiving
// location updates if the user has requested them.
if (mRequestingLocationUpdates && checkPermissions()) {
startLocationUpdates();
} else {
requestPermissions();
}
updateUI();
}
cr. https://github.com/permissions-dispatcher/PermissionsDispatcher/issues/90#issuecomment-207952388