I have some problem witch sharing PDF file (in xamarin android). I'm using iTextSharp for generate pdf, after that i'm saving file to path: "/data/user/0/com.example/files/confirmation.pdf", and now i can display this pdf - everything works good, but now i'm trying to share this pdf:
var intent = new Intent(Intent.ActionSend);
intent.SetType("application/pdf");
Java.IO.File file = new Java.IO.File("/data/user/0/com.example/files/confirmation.pdf");
Android.Net.Uri path = Android.Net.Uri.FromFile(file);
intent.PutExtra(Intent.ExtraStream, path);
intent.PutExtra(Intent.ExtraText, string.Empty);
intent.PutExtra(Intent.ExtraSubject, message ?? string.Empty);
var chooserIntent = Intent.CreateChooser(intent, title ?? string.Empty);
chooserIntent.SetFlags(ActivityFlags.ClearTop);
chooserIntent.SetFlags(ActivityFlags.NewTask);
_context.StartActivity(chooserIntent);
Now i can chose how to share file, and when i'm picking "Gmail", gmail shows with warning "Permission denied for the attachment". How can i deal with this?