compat/src/main/java/androidx/core/content/MimeTypeFilter.java
@Nullable
    public static String matches(
            @Nullable String[] mimeTypes, @NonNull String filter) {
        if (mimeTypes == null) {
            return null;
        }

        final String[] filterParts = filter.split("/");
        for (String mimeType : mimeTypes) {
            final String[] mimeTypeParts = mimeType.split("/");
            if (mimeTypeAgainstFilter(mimeTypeParts, filterParts)) {
                return mimeType;
            }
        }

        return null;
    }
/**
     * Matches multiple MIME types against an array of MIME type filters.
     * @return The first matching MIME type, or null if nothing matches.
     */
Matches multiple MIME types against an array of MIME type filters.
@return The first matching MIME type, or null if nothing matches.
Matches multiple MIME types against an array of MIME type filters . @return The first matching MIME type or null if nothing matches .
@Nullable
    public static String matches(
            @Nullable String[] mimeTypes, @NonNull String filter) {
        if (mimeTypes == null) {
            return null;
        }
        final String[] filterParts = filter.split("/");
        for (String mimeType : mimeTypes) {
            final String[] mimeTypeParts = mimeType.split("/");
            if (mimeTypeAgainstFilter(mimeTypeParts, filterParts)) {
                return mimeType;
            }
        }
        return null;
    }
@ Nullable public static String matches ( @ Nullable String [ ] mimeTypes , @ NonNull String filter ) { if ( mimeTypes == null ) { return null ; } final String [ ] filterParts = filter . split ( "/" ) ; for ( String mimeType : mimeTypes ) { final String [ ] mimeTypeParts = mimeType . split ( "/" ) ; if ( mimeTypeAgainstFilter ( mimeTypeParts , filterParts ) ) { return mimeType ; } } return null ; }
Matches multiple MIME types against an array of MIME type filters.
Matches multiple MIME types against an array of MIME type filters .