Application lifecycle at the example of chronometer
<p>I have an application with a Chronometer in its main activity. The Chronometer is used as a timer. This timer should keep running once the device's screen is off. I noticed that once the timer is running and I turn off my screen for a longer period of time, and turn in on again, the Chronometer stops running (it's reset to 00:00). If I off my screen for perhaps 2 hours, it would still run, but once it's over night (approx. 8 hours), the next morning the Chronometer stopped running. How can I achieve a behavour that the Chronometer runs until the user turns it off, even if the screen is off for some hours? Thanks. </p>
