简体   繁体   English

Windows Phone 8 ShareMediaTask异常

[英]windows phone 8 ShareMediaTask exception

am trying to share an image with ShareMediaTask. 正在尝试与ShareMediaTask共享图像。

all things works except after reaching the share app my app crashes with application unhand led exception 一切都正常,但到达共享应用程序后我的应用程序因应用程序意外导致的异常而崩溃

using (Stream current = await svfile.OpenStreamForWriteAsync())
        {
            var picture = lib.SavePicture("share", current);
            ShareMediaTask task = new ShareMediaTask();


            task.FilePath = picture.GetPath();

            task.Show();

            System.Diagnostics.Debug.WriteLine("yessss");
        }

its the same with mail also after reaching selection view of mail app crashes in background . 在到达邮件应用程序选择视图后,在后台崩溃时,邮件也是如此。

//Save image to media library
//toShare is the stream source. 
//Don't use using statement to get stream

MediaLibrary library = new MediaLibrary();
var picture = library.SavePicture("Memefy_Photo", toShare);

//Open ShareMediaTask
var task = new ShareMediaTask();
task.FilePath = picture.GetPath();
task.Show();

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

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