Android set last modified time for file

I use "public boolean setLastModified (long time)" to set the file modification time, but always returns false. I saw several similar posts related to this, but none of them could work for me. can someone give me a solution for this?

Please do not post me the URLs, I have already seen them:

file.lastModified () was never installed with file.setLastModified ()

Is it possible to use reset the last modified date of an Android file?

http://www.mkyong.com/java/how-to-change-the-file-last-modified-date-in-java/

+6
source share
1 answer

setLastModified() seems to be unreliable on Android , it may work on some devices, and not on others.

+14
source

Source: https://habr.com/ru/post/953399/