'How to delete all files by date?

trying to delete all files, which are newer than specified time on versions Q+

    val result = resolver.delete(
        MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "datetaken > ?",
        arrayOf(timestamp.toString())
    )

however they are not deleted, result shows always 0.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source