app/src/main/java/com/bluetooth/communicatorexample/tools/Tools.java
public static boolean hasPermissions(Context context, String... permissions) {
        for (String permission : permissions) {
            if (ContextCompat.checkSelfPermission(context, permission) != PackageManager.PERMISSION_GRANTED) {
                return false;
            }
        }
        return true;
    }
/**
     * Returns true if the app was granted all the permissions. Otherwise, returns false.
     */
Returns true if the app was granted all the permissions. Otherwise, returns false.
Returns true if the app was granted all the permissions . Otherwise returns false .
public static boolean hasPermissions(Context context, String... permissions) {
        for (String permission : permissions) {
            if (ContextCompat.checkSelfPermission(context, permission) != PackageManager.PERMISSION_GRANTED) {
                return false;
            }
        }
        return true;
    }
public static boolean hasPermissions ( Context context , String ... permissions ) { for ( String permission : permissions ) { if ( ContextCompat . checkSelfPermission ( context , permission ) != PackageManager . PERMISSION_GRANTED ) { return false ; } } return true ; }
Returns true if the app was granted all the permissions.
Returns true if the app was granted all the permissions .