When the application turns off or turns off the screen, time stops. Why? Tried three options.
Activitycreates ahandlerand sends it to the service. The service launchesTimer.Timeronce a second sends its state through thehandler(updatesTextViewin the originalActivity). Those. just "ticking" time in the corner of the screen.Everything is the same, just not using the
Timerclass, but just creating aThread. And theServicestarts it. ThisThreadthrough thehandlerupdates theActivityelement.I do not create any threads, all the logic in the main thread
Service-UIhangs.
Why and how to make it work?