location-samples icon indicating copy to clipboard operation
location-samples copied to clipboard

Infinity loop in showing snackbar, if deny permission with enabled checkbox "Don't ask again"

Open anddever opened this issue 8 years ago • 9 comments
trafficstars

anddever avatar Jun 15 '17 08:06 anddever

@anddever which sample has this problem? Can you provide some more information?

samtstern avatar Jun 15 '17 15:06 samtstern

LocationUpdates, https://youtu.be/s67KFWppBj8

anddever avatar Jun 16 '17 01:06 anddever

I can repro. I'll submit a fix shortly.

shailen avatar Jul 10 '17 20:07 shailen

@shailen any solution to this issue?

shukerullah avatar Sep 22 '17 08:09 shukerullah

Waiting for response

shukerullah avatar Oct 18 '17 17:10 shukerullah

any solution?

vince688 avatar Nov 08 '17 14:11 vince688

I don't know why they are ignoring this annoying issue.

shukerullah avatar Nov 10 '17 11:11 shukerullah

@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.

jonbhanson avatar Apr 27 '20 16:04 jonbhanson

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

ZzMonsterr avatar Oct 14 '22 07:10 ZzMonsterr