am trying to share an image with 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();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.