Get the previous (old) time after changing the time

I can receive time change events using translation events ( ACTION_TIME_CHANGEDand ACTION_DATE_CHANGED).

I need to get the previous time after changing the time . For example, the current time is 10:00. I am going to change the time until 12:00. After changing the time, the time will be changed to 12:00, but I need to get the previous time (10:00) during the time change.

Note. The time can be changed from any other application or from the settings.

+4
source share
2 answers

Perhaps the solution I found may help you:

( , ?)

BOOT System.currentTimeMillis() SystemClock.elapsedRealtime(). .

( , ), , diff == 0, System.currentTimeMillis().

+2

sharedpreferences i.e u ,

0

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


All Articles