@Override public void onRequestPermissionsResult(int requestCode,@NonNull String[] permissions,@NonNull int[] grantResults){
  if (requestCode == ALLOW_PERMISSIONS && grantResults.length > 0) {
    List<String> permissionsNotAllowed=new ArrayList<>();
    for (int i=0; i < permissions.length; i++) {
      if (grantResults[i] == PackageManager.PERMISSION_DENIED) {
        permissionsNotAllowed.add(permissions[i]);
      }
    }
    if (permissionsNotAllowed.isEmpty()) {
      initEvent();
    }
 else {
      permissionNotEnabled();
    }
  }
 else {
    permissionNotEnabled();
  }
}

@ Override public void onRequestPermissionsResult ( int requestCode , @ NonNull String [ ] permissions , @ NonNull int [ ] grantResults ) { if ( requestCode == ALLOW_PERMISSIONS && grantResults . length > 0 ) { List < String > permissionsNotAllowed = new ArrayList < > ( ) ; for ( int i = 0 ; i < permissions . length ; i ++ ) { if ( grantResults [ i ] == PackageManager . PERMISSION_DENIED ) { permissionsNotAllowed . add ( permissions [ i ] ) ; } } if ( permissionsNotAllowed . isEmpty ( ) ) { initEvent ( ) ; } else { permissionNotEnabled ( ) ; } } else { permissionNotEnabled ( ) ; } }
this method is a callback . check the user ' s answer after requesting permission .
