Reputation:
I need to open a file from storage. I used Launcher.OpenAsync()
, but it always tries to open the file in PDF reader. Is there any other way to open a file with default app on Android?
This is the code I have already tried.
private void OpenDocument(string filePath)
{
var localFile = "file://" + filePath;
Launcher.OpenAsync(localFile);
}
Upvotes: 3
Views: 5877
Reputation: 71
string path = "your uri bla-bla-bla";
Launcher.OpenAsync
(new OpenFileRequest()
{
File = new ReadOnlyFile(path)
}
);
Upvotes: 7