0
I’m getting the location data using the LocationManager
on Android and would like to know how I can catch the action only if the user allow the app accesses your location data.
For example, using the code below, I can pick up according to the positive permission of the user, I need before he accepts the permission to then work up
However, I need to take the precise data if the user has already allowed it or not, to work on this data regardless of whether he accepts it or not. It is possible?
@Override
protected void onResume() {
super.onResume();
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_GRANTED) {
//O que precisa fazer se a permissão for aceita.
}
}
Thank you, brother. I think I’d better implement a library even to handle the exceptions to the permissions. But is there no way to get the stastus just the status if Runtime permissions have already been allowed or not? Valeuu!
– ruybarreto