防止“开始”菜单、相机按钮被逻辑删除 WP7 应用程序
我有一个 WP7 应用程序,我已禁用手机的空闲功能,例如:
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
PhoneApplicationService.Current.ApplicationIdleDetectionMode =
IdleDetectionMode.Disabled;
但是,相机按钮和开始菜单仍然会暂停该应用程序,然后再恢复它。我希望无论按下这些按钮,应用程序都能运行。如何防止这些按钮对应用程序进行逻辑删除?
I have a WP7 application that I've disabled the idle capabilities of the phone with such as:
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
PhoneApplicationService.Current.ApplicationIdleDetectionMode =
IdleDetectionMode.Disabled;
However, the camera button and start menu still pause the application and resume it afterwards. I want the app to run regardless of these buttons being pushed. How can I prevent these buttons from tombstoning the app?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果用户按下
windows 键
或相机按钮
,墓碑总是会发生。您显示的代码可确保您的应用程序将继续在锁定屏幕下运行,而不是在您的应用程序被逻辑删除时运行。在当前版本 (7.0) 中,没有第三方多任务处理,而 Mango (7.1) 允许在多任务处理方面有更多自由。大概这个应用程序的目标是 7.0,所以你的应用程序将被逻辑删除,你将不得不处理它。无法让您的应用程序继续在后台运行。
顺便说一句,您仍然需要在 Mango 中处理逻辑删除,但您确实获得了更多在后台运行应用程序的能力。
Tombstoning always occurs if the user presses the
windows key
orcamera button
. The code you've shown ensures that your app will continue to run under a lock screen, not if it will run when your app is tombstoned. In the current version (7.0), there is no multitasking for third parties, whereas Mango (7.1) allows for some more freedom with respect to multitasking.Presumably this app is targetted at 7.0, so your app will be tombstoned and you will have to handle it. There is no way of having your app continue running in the background.
On a side note, you'll still have to handle tombstoning in Mango as well, but you do get more abilities to run your app in the background.