8

I have been using " public boolean setLastModified (long time) " for setting the file modified time but it always return false. I have seen few similar posts related to this but none of them could work for me. can someone give me solution for this?

Please do not post me any URL's, I have already seen them :

file.lastModified() is never what was set with file.setLastModified()

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

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

4

2 回答 2

18

setLastModified()在 Android 上显然不可靠,可能在某些设备上工作而不在其他设备上工作。

于 2013-09-07T21:00:26.623 回答
0

您被告知要测试返回值,如果失败则返回 false。失望地发现这...

于 2018-10-11T13:48:24.577 回答