Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我为具有计时器的 Windows Phone 8 制作了一个应用程序。我的问题是,一旦手机锁定屏幕,我的计时器(我猜我的应用程序)就会暂停。我不想阻止手机进入锁定屏幕,我希望我的应用程序在后台运行。我想不出一个“干净”的方法来做到这一点。
听起来您只需要正确启用您的应用程序即可在锁定屏幕下继续运行。看一眼:
在锁定屏幕下运行 Windows Phone 应用程序
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
将此行放在 App.xaml.cs 页面的 App() 构造函数下