0

Just need to know what to handle for this situation:

Case(1) When user is not doing anything on the screen for a period of time

The system will suspend the app? Is this what causes suspension? This means nothing will be processed in the background?

How to handle this case that I want the process continues when app is left unattended (example : Using GPS )

----- Update

Need some confirmations for the following scenarios:

1) App is launched and user navigates from mainPage to other Page AND left the Tablet alone for a period of time and user did not interact with the Screen.

In this case, this will cause the Physical screen turn to black color screen. Is this means app Suspension or something else?

2) How Lock Screen or Screen Lock work or when it will happen. how different is screenLock from above question(1)? or they are the same thing?

Screen Lock will cause App Suspension?

3) When user presses the home button (Hardware button) on the tablet, this will cause App Suspension or termination?

4) In Windows Phone, there are these to detect and prevent Screen Lock and run the app :
a.The UserIdleDetectionMode property
b.The ApplicationIdleDetectionMode property

Can these be used in WinRT App? or how to handle this like WP in WinRT

4

1 回答 1

0

如果应用程序是前台应用程序并且屏幕处于活动状态,则不会暂停。应用程序暂停主要是为了移动到后台。这不仅仅是空闲时间,还可能是锁屏/屏幕保护程序之类的东西出现并且窗口不再处于活动状态。

您可以通过查看 Window.Activated 事件立即知道这一点,但在这种情况下,停用的窗口(假设它是应用程序的唯一和主要窗口)可能意味着它进入后台并因此排队等待挂起。

是的,一旦暂停,应用程序就不会运行任何代码——如果您希望后台代码运行,您需要使用后台任务(请参阅 MSDN 示例以获取示例)。

于 2013-09-13T03:02:52.750 回答