on-internet
← Community

Use of the checkSelfPermission in Android?

Stack Overflow ·

I'm working on an app that needs multiple permissions from the user (location, external storage, camera and phone state) and if i put the requests one after the other, only one is asked to the user when i run the app, which is a problem : if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { //ask for the location permission ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.AC

Comments

Sign in or sign up to comment and upvote.

No comments yet.