In my application I download the pdf from an API and store the file on the local file system. Then I try to open the pdf file with the built in viewer of the user. The next message appear:
*.pdf file exposed beyond app through intent.getdata().
public static void OpenPDF(Context context, string filePath)
{
//Open it up
Android.Net.Uri pdfPath = Android.Net.Uri.FromFile(new Java.IO.File(filePath));
Intent intent = new Intent(Intent.ActionView);
intent.SetDataAndType(pdfPath, "application/pdf");
intent.SetFlags(ActivityFlags.GrantReadUriPermission);
intent.SetFlags(ActivityFlags.NewTask);
intent.SetFlags(ActivityFlags.ClearWhenTaskReset);
context.StartActivity(intent);
}
Am i missing something?