Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

UIDocumentInteractionController.PresentOpenInMenu does nothing

$
0
0

Hello. I'm trying to open a file I've just downloaded but nothing happens when i try opening it with PresentOpenInMenu.

Here's my code for downloading:

` using (var fileStream = await msg.Content.ReadAsStreamAsync()) { var documents = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments); string path = Path.Combine(documents, doc.CaseId.ToString());

System.IO.Directory.CreateDirectory(path);
string filePath = System.IO.Path.Combine(path, doc.FileName);
using (var file = File.Open(filePath, FileMode.Create, FileAccess.Write))
{
    MemoryStream mem = (MemoryStream)fileStream;
    mem.WriteTo(file);
}

} `

And here's when i try opening the file:

var viewer = UIDocumentInteractionController.FromUrl(NSUrl.FromFilename(filePath));
viewer.PresentOpenInMenu (this.View.Frame, this.View, true);

And as i said when the code has run nothing happens.

What am i doing wrong?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>