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

        final ArrayList<String> list = new ArrayList<>();
        final String[] filterParts = filter.split("/");
        for (String mimeType : mimeTypes) {
            final String[] mimeTypeParts = mimeType.split("/");
            if (mimeTypeAgainstFilter(mimeTypeParts, filterParts)) {
                list.add(mimeType);
            }
        }

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