getFileAttachments

Retrieves all file attachments from the device's external storage.

This method queries the MediaStore for all files that have a valid MIME type, excluding folders and files with unknown types. The results are sorted by date added in descending order (most recent first).

Note: This method performs a potentially expensive query operation and should be called from a background thread to avoid blocking the UI.

Return

A list of AttachmentMetaData objects representing all files on the device, or an empty list if the query fails or returns no results.

Parameters

context

The Android context used to access the content resolver.

See also

For retrieving only images and videos.