I'm picking up location data using LocationManager
on Android and would like to know how I can get the action only if the user allows the app to access your data location.
For example, using the code below, I can pick up according to the user's positive permission, I need it before he accepts the permission to work on it later
However, I need to pick up the precise data in case the user has already allowed or not, to then work on that data regardless of whether he accepts it or not. Is it 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.
}
}