Forum Xamarin Xamarin.Forms

Timer goes on when the device is on lock.

KhosrouKhosrou Member ✭✭✭

Hi fellas,

I've implemented a timer, but when I lock my device or change the page, the timer does not go on. How can I fix this issue? Please help.

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    I've implemented a timer,

    Why? Rarely the best choice. Personally I do a task.Delay(1000) at an app-scoped level. Then raise a "ClockTick" event.
    Now you have a system wide synchronized heartbeat. Then react to the event.
    That works in background.
    Timers are too much overhead for what they do and if you have 10 of them they are out of sync with each other.

Sign In or Register to comment.