Found a solution to the problem:
new Date(System.currentTimeMillis()
- SystemClock.elapsedRealtime()
+ elapsedTime);
where elapsedTimeis the time I get from Android. As far as I checked, this seems to return the correct date / time for elapsed time. I just do not really like this answer because Google does not recommend using System.currentTimeMillis(). If someone does not have a better answer, I close this question, as was said.
source
share