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

False positive when accessing the location #3

Open
BenLscr opened this issue Oct 28, 2020 · 0 comments
Open

False positive when accessing the location #3

BenLscr opened this issue Oct 28, 2020 · 0 comments

Comments

@BenLscr
Copy link

BenLscr commented Oct 28, 2020

I was working with permissionskt sinceone year and know the lint give a false postive when accessing the location.

askPermissions(
            Manifest.permission.ACCESS_FINE_LOCATION,
            Manifest.permission.ACCESS_COARSE_LOCATION
        ) {
            onGranted {
                val fusedLocationClient =
                    LocationServices.getFusedLocationProviderClient(this@HomeActivity)
                fusedLocationClient.lastLocation.addOnSuccessListener { location: Location? ->
                    if (location != null) {
                        
                    } else {
                        showSnackBar("No location")
                    }
                }
            }
        }

fusedLocationClient.lastLocation is completely red because android studio tell you to asking for permissions.
For the moment i have added @SuppressLint("MissingPermission") on my function.

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

No branches or pull requests

1 participant