I'm working on an Android app and I have this problem.
For example, if I delete a file (operation A) and I receive a new file (operation B), I want to know how much time has passed between the two operations. I want it to work also if, in between, the user changes the date of the system, turns off the internet or restarts the device.
I know that exists SystemClock.elapsedRealtime()
but its value restarts from zero if the user restarts the device.
I cannot use System.currentTimeMillis()
because it changes if user changes the date.
I cannot get a date from the internet.
Thanks
No comments:
Post a Comment