0

i am developing a windows phone app in which i fetching some data from service at that moment the device will go to auto lock since it is un - responsive for long time.

so , how can i avoid this auto locking in the windows phone app when some process/fetching/syncing is happening with services.

i am not able test this scenario since i am testing it on an emulator.

1) how to avoid auto locking feature in windows phone app when it is running? 2) What are the various possible ways in which i can do this ?

Please help me out.

Thanks in Advance.

user1516781
  • 973
  • 1
  • 20
  • 42

1 Answers1

2

You can do the following:

using Microsoft.Phone.Shell;

PhoneApplicationService phoneAppService = PhoneApplicationService.Current;
phoneAppService.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;

This will disable auto locking of screen. Let me know if this works.

Edit: This code should be added in App.xaml.cs in the constructor for it to work.

Rishi Jasapara
  • 638
  • 9
  • 33