public void requestAfterExplanation(@NonNull String[] permissions){
  ArrayList<String> permissionsToRequest=new ArrayList<>();
  for (  String permissionName : permissions) {
    if (isPermissionDeclined(permissionName)) {
      permissionsToRequest.add(permissionName);
    }
 else {
      permissionCallback.onPermissionPreGranted(permissionName);
    }
  }
  if (permissionsToRequest.isEmpty())   return;
  permissions=permissionsToRequest.toArray(new String[permissionsToRequest.size()]);
  ActivityCompat.requestPermissions(context,permissions,REQUEST_PERMISSIONS);
}

public void requestAfterExplanation ( @ NonNull String [ ] permissions ) { ArrayList < String > permissionsToRequest = new ArrayList < > ( ) ; for ( String permissionName : permissions ) { if ( isPermissionDeclined ( permissionName ) ) { permissionsToRequest . add ( permissionName ) ; } else { permissionCallback . onPermissionPreGranted ( permissionName ) ; } } if ( permissionsToRequest . isEmpty ( ) ) return ; permissions = permissionsToRequest . toArray ( new String [ permissionsToRequest . size ( ) ] ) ; ActivityCompat . requestPermissions ( context , permissions , REQUEST_PERMISSIONS ) ; }
to be called when explanation is presented to the user
