2

When the user installs the application for the first time on Windows Mobile, I am creating some encryption keys to do the authentication of the application with some webservices.

The problem that I have is that the phone is autolocking and the task is canceled. I am not able to prevent it from closing.

I have used this in the mainpage.xaml load:

PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; 

and even in the App.xaml:

 private void Application_Launching(object sender, LaunchingEventArgs e) { PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; } 

but still it is not working. Any help, please, the task is taking about 2 min.

1 Answer 1

4

You need to set ApplicationIdleDetectionMode. See http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.shell.phoneapplicationservice.applicationidledetectionmode(v=vs.105).aspx.

Sign up to request clarification or add additional context in comments.

1 Comment

Agree. That's the way to go. VS2012 has this setting on its WP8 template.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.