Daniel Müller
Daniel Müller

Reputation: 411

Timer stops when screen gets locked Windows Phone 8

I made an application for Windows Phone 8 which features a timer. My problem is, that as soon as the phone locks the screen, my timer (and my application I guess) pauses. I don't want to stop the phone from going into lock screen, I want my application to run in background. I can't figure out a 'clean' way to do this.

Upvotes: 0

Views: 1249

Answers (2)

Poojan Dave
Poojan Dave

Reputation: 119

 PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;

put this line under App() constructor of App.xaml.cs page

Upvotes: 0

Justin Niessner
Justin Niessner

Reputation: 245489

It sounds like you just need to properly enable your app to continue running under the lock screen. Take a look at:

Running a Windows Phone Application under the lock screen

Upvotes: 1

Related Questions