I use the following code to know if the user granted the geolocation permission and display an alert if it is not the case:
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.ACCESS_FINE_LOCATION }, 1);
}
So requestPermissions displays a system alert asking the user if he is ok with the use of its geolocation by the app.
What I want is to detect the click on the buttons "yes" or "no" of this alert in order to launch specific actions in both cases.
Is there a way to to this ? Or a workaround ?
Thanks.