简体   繁体   English

Windows Phone 8.1后台任务突然退出

[英]Windows phone 8.1 background task abrupt exit

I am Working on windows phone 8.1 background tasks API. 我正在开发windows phone 8.1后台任务API。 As see in all the other threads of background task API here on stack overflow, there is no definite answer to how long the background task runs, as in we cannot map the 2 CPU seconds to the wall clock time. 正如在堆栈溢出中的后台任务API的所有其他线程中所见,对于后台任务运行的时间没有明确的答案,因为我们无法将2个CPU秒映射到挂钟时间。 That means it can exit abruptly. 这意味着它可以突然退出。

So my question is, is there an handler that we can use to make sure that the application see why the background task ended abruptly. 所以我的问题是,是否有一个处理程序,我们可以用来确保应用程序看到后台任务突然结束的原因。 Probably log the events of action and reason for the exit ? 可能记录行动事件和退出原因?

I just use console.log while the background task is running, keeping in debug mode to see the console, and can therefore pinpoint exactly where the background task crashed. 我只是在后台任务运行时使用console.log,保持调试模式以查看控制台,因此可以精确查明后台任务崩溃的位置。 Once you know where, validate your code and look for any errors. 一旦知道了哪里,验证您的代码并查找任何错误。 If you find none, you probably ran out of memory and the task was cancelled. 如果找不到,则可能内存不足,任务被取消。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM