@Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == 1) { // Use this method to check if all the permissions are GRANTED. if (areAllPermissionsGranted(grantResults)) { get_location(); asw_view.loadUrl(url); } } } // Method to check if all the results are GRANTED. private Boolean areAllPermissionsGranted(int[] grantResults) { boolean isGranted = false; if (grantResults.length > 0) { for (int grantResult : grantResults) { if (grantResult == PackageManager.PERMISSION_GRANTED) { isGranted = true; } else { // if a single permission is NOT_GRANTED, return from the method. return false; } } } return isGranted; }
requestPermissions()
areAllPermissionsGranted
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)