In my android application I would like to block the user from changing the device time when my application is opened or minimised. The user should be able to change only once the app gets closed.
Please share your valuable suggestions.
Thanks in advance 🙂
There is an API that will tell you how much time has passed since the device was booted, regardless of what the device clock is set to:
SystemClock.elapsedRealtime()“returns milliseconds since boot, including time spent in sleep.”