getAttachmentsFromUriList

Queries a list of content URIs and returns parsed attachment metadata for each.

This method is useful when you have specific URIs (e.g., from an intent or file picker) and need to extract their metadata for attachment processing. Each URI is queried individually using the content resolver to retrieve:

  • Display name

  • MIME type (with fallback to content resolver type)

  • File size

URIs that cannot be queried or return no data are filtered out from the result. The attachment type (image, video, or file) is automatically determined based on the MIME type.

Return

A list of AttachmentMetaData objects with parsed metadata. URIs that fail to resolve are omitted from the result.

Parameters

context

The Android context used to access the content resolver.

uriList

The list of content URIs (using the content:// scheme) to query.

See also

For querying all files from device storage.

For querying all media from device storage.