简体   繁体   English

Windows Phone 8.1 File Picker恢复问题

[英]Windows Phone 8.1 File Picker resuming issue

I am developing a Windows Phone 8.1 application where on appbarbutton click, I open a file picker. 我正在开发Windows Phone 8.1应用程序,在其中单击appbarbutton时,我会打开一个文件选择器。 The app works fine when I run it via visual studio. 当我通过Visual Studio运行该应用程序时,它运行良好。

But when I run it on the device without being connected to Visual studio,the file picker launches and shows photos library and after I select a photo and click the ok button the screen says resuming for 2-3 secs and the app crashes! 但是,当我在未连接Visual Studio的情况下在设备上运行它时,文件选择器将启动并显示照片库,选择照片并单击“确定”按钮后,屏幕将显示2-3秒钟的恢复时间,并且应用程序崩溃!

I have tried setting the Start action of Debug to "Do not launch,but debug my code when it starts" and tried suspend and shutdown option in lifecyle process when the file picker screen is showed. 我尝试将“调试”的“开始”操作设置为“不启动,但在启动时调试我的代码”,并在显示文件选择器屏幕时在生命周期过程中尝试暂停和关闭选项。 The app calls the Onsuspending method when I do that. 当我这样做时,该应用程序将调用Onsuspending方法。 But after my selection the app does not call the OnActivated method and shows "resuming..." for a long time until I stop debugging. 但是,在我选择之后,该应用程序不会调用OnActivated方法,并且会长时间显示“正在恢复...”,直到我停止调试为止。

I have beeing also stuck on this error and even this example File picker sample has not helped me. 我也很想知道这个错误,即使这个示例文件选择器示例也没有帮助我。

Have manualy check activation event of my page and also NavigatedTo event. 手动检查我页面的激活事件以及NavigatedTo事件。 Comment all the code inside, uncomment line by line and found bug. 注释其中的所有代码,逐行取消注释并发现bug。 So, can recommend to do the same. 因此,可以建议您这样做。 Was unable to debug also even with "Do not launch,but debug my code when it starts" checked like described in manual 即使按照手册中的说明进行了检查,即使使用“不启动但在启动时调试我的代码”也无法进行调试

I had the same issue. 我遇到过同样的问题。 After selecting image, os wrote Resuming.. and crash. 选择图像后,os写了Resuming ..并崩溃。 Problem was with my MediaCapture. 问题出在我的MediaCapture上。 First use mediaCapture.stopPreviewAsync(); 首先使用mediaCapture.stopPreviewAsync(); to stop preview and than you must release the mediaCapture. 要停止预览,则必须释放mediaCapture。 Before you call fileOpener use this code: 在调用fileOpener之前,请使用以下代码:

newCapture.Dispose();

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

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