To check if the user has already granted your app a particular permission, pass that permission into the ContextCompat. checkSelfPermission() method . This method returns either PERMISSION_GRANTED or PERMISSION_DENIED , depending on whether your app has the permission.
Read moreHow do I set location permissions on Android?
Find which apps use your phone’s location
Read moreWhat apps should have location permission?
The apps that ask
Read more