快速按下后退按钮时的 WebBrowserTask 错误 (WP7) [英] WebBrowserTask bug when pressing the back button very quickly (WP7)

查看:18
本文介绍了快速按下后退按钮时的 WebBrowserTask 错误 (WP7)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个单击按钮时调用的 WebBrowserTask:

I have a WebBrowserTask which is called when a button is clicked:

    private void button1_Click(object sender, RoutedEventArgs e)
    {
        WebBrowserTask webBrowserTask = new WebBrowserTask();
        webBrowserTask.URL = "http://msdn.microsoft.com";
        webBrowserTask.Show();
    }

当我在我的应用程序中点击这个按钮,然后我很快点击设备的后退按钮时,我的应用程序崩溃了,甚至没有调用 Application_Activated() 方法..

when i click this button in my app, and then I click the back button of the device very quickly, my app crashes, and the Application_Activated() method doesn't even called..

这是 SDK 的错误吗?您可以在模拟器或设备上轻松重现该问题.

Is this a bug of the SDK? You can reproduce the problem very easily on the emulator or on your device.

有什么解决方法吗?这似乎发生在所有任务(短信、电子邮件等)中.

Any workarounds? This seems to happen in all tasks (sms, email etc).

谢谢

推荐答案

您确定跳过的是您的 Application_Activated 而不是您的构造函数?

Are you sure it's your Application_Activated being skipped and not your Constructor?

如果它崩溃是因为你的构造函数没有被调用,那么你很可能已经足够快地重新启动了你的应用程序,以至于它没有像彼得在这里更详细地描述的那样被墓碑化.

If it's crashing because your constructors not being called it's likely you've restarted your app fast enough for it to have not been tombstoned as Peter describes in more detail here.

如何正确处理应用程序停用和重新激活 - Peter Torr 的博客

如果也不是这种情况,是否有可能您的应用最初不是使用 RTM 工具创建的,需要根据新的项目模板进行迁移?

If this isn't the case either, is it possible your app wasn't initially created using the RTM tools and needs to be migrated per the new project templates?

这篇关于快速按下后退按钮时的 WebBrowserTask 错误 (WP7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆