- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有一个 WP7 应用程序,有时需要进行长时间(5-25 秒)的处理。
对于 Mango,当应用程序设置为休眠状态时正在处理(例如:用户按下 Windows 按钮或锁定屏幕),当用户返回时,应用程序会崩溃。
我在模拟器和我的设备上试过,行为相同。
如果我在 Visual Studio 的 Debug模式下重现它,它不会崩溃,所以很难找到真正发生的事情。
要重现它,启动一个新的 Windows Phone 项目,在 MainPage.xaml 上添加一个按钮,并在执行无限循环的点击事件上添加一个事件处理程序:
while (true)
{
System.Threading.Thread.Sleep(100);
}
我的问题是:到底发生了什么?为什么会崩溃?快速应用切换不应该只是暂停应用进程并恢复它吗?
编辑:我注意到的另一件事是,在运行繁重的进程时,停用和激活的事件似乎不会在我离开/进入应用程序时引发。
最佳答案
在官方 Windows Phone 论坛 ( link ) 上找到了答案。在这里:
为什么会崩溃:
From the time the app is deactivated, it has exactly ten seconds to finish up what it is doing. If the code takes more than ten seconds, the OS will terminate the app.
为什么当我离开/进入应用程序时没有引发停用和激活事件:
If the process is blocking the UI thread this also blocks the message dispatch loop so I suspect that this is the reason why your app never gets a chance to detect and handle the events.
关于c# - Mango 快速应用程序切换和大量处理崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7063261/
我有一个 WP7 应用程序,有时需要进行长时间(5-25 秒)的处理。 对于 Mango,当应用程序设置为休眠状态时正在处理(例如:用户按下 Windows 按钮或锁定屏幕),当用户返回时,应用程序会
如果我有这样的文档,是否有一个芒果查询可以用来查找签名数组中的 uid 与根目录中的 uid 匹配的所有文档文件? { _id: "1", uid: "12345", sign
我有一个沙发数据库,里面装满了这种形式的条目 { ... "templates" :[ {"template_id":"1"} {"template_id":"2"}
我有一个芒果查询: { "selector": { "age":{ "$eq": 22 } } } 我想知道满足此条件的文档数量。 我知道我们可以使用映射归约函
我的文档的结构如下: { "Calibration": { "Presettings": { "Date": [ { "Value": "2
当用户想要搜索数据库时,我使用 Mango 查询和 Couchdb。他们可以按文档中的多个字段进行搜索。 为简化起见,我有一个包含三个字段的文档,所有这些字段都可以通过搜索找到该文档。 FieldOn
我的目标是创建一个简单的 javaScript 实时串行图表,使用 mango 自动化数据点获取其数据。 我对数据点本身没有任何问题,但尝试将图表链接到数据点确实很痛苦。我尝试使用两种不同类型的教程(
我目前正在开发一款应该能够在建筑物内导航的应用程序 - 基本思想是拥有建筑物示意图,逐层显示,并在每一层告诉你去哪里到下一层一。一旦你在下一层,你按下一个按钮,它的架构就会出现。 虽然这很好用,但我想
我需要为 WP Mango 创建图表。因此,我有几个可能很有趣的“什么/如何”问题: 什么... ...用于此目的的框架或工具? ...更好用,Silverlight 还是 XNA(或混合)? ...
我想在 wp7 应用程序的内置键盘上设置样式(实际上只是更改颜色)。我正在创建一个 Silverlight 项目,并使用 a 作为输入,并且焦点上有默认样式的键盘。有没有办法设计这个键盘的样式?我尝试
我现在开始将一个应用程序迁移到 WP7 Mango。原因之一是数据库支持:-) 从技术上讲,数据库的事情非常清楚。但我有点不确定我应该把我的数据上下文放在哪里。我看到主要的两个选项: 一切的全局数据上
我正在创建一个使用 WP7 Mango 相机 API 的应用程序。在应用程序中,我需要在不同的焦点处拍照,是否可以通过编程方式设置相机焦点? 最佳答案 你需要那个方法 PhotoCamera.Focu
我最近将我的 WP7 应用程序升级到 Mango,但相机出现了一些问题。下面的代码曾经在 7.0 上工作,但在 7.1 上,完成的处理程序甚至在对话框显示之前就触发了,所以我无法捕获结果。拍照后,手机
我有一个使用本地 SqlCe 数据库的 Mango WP7.5 应用程序。我想添加一个 LiveTile 更新,显示基于当前日期和月份从本地数据库获取的信息。 我发现的所有示例都通过从服务器下载远程图
2012年8月,本文发表http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh286406%28v=vs.92%29.aspx其
我刚刚注意到 the release notes Couchdb 2.0 中提到,新应用程序推荐使用 Mango 查询。还提到,显然 Mango 索引比 javascript 查询快 2 倍到 10
编辑:这是在 Windows 7.1 RC 下。 (此代码确实适用于 7.0) 假设我们在黑暗主题中打开应用程序。一行代码来检测这一点如下: isDarkTheme = (Visibility
或者调试只适用于模拟器? 最佳答案 It's said运行 Mango 的开发人员设备可能会在以后提供,但目前,您只能在模拟器中调试 Mango 项目。 编辑 - Mango Beta 现在可供开发人
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
想知道是否有人知道在初始屏幕中保持良好平滑渐变的方法?我已经尝试过 .jpg 和加载直接 xaml 作为 Logo 控制资源,并且我已经嵌入了一个 View 框。在模拟器中它看起来很棒!虽然在手机上它
我是一名优秀的程序员,十分优秀!