B4X:
Dim FileName As String = "APPNOTES.PDF"
'copy the shared file to the shared folder
File.Copy(File.DirInternal, FileName , Starter.Provider.SharedFolder, FileName )
Dim email As Email
email.To.Add(EmailAddress.Text)
email.Subject = "Homework"
email.Attachments.Add(Starter.Provider.GetFileUri(FileName ))
'email.Attachments.Add(Starter.Provider.GetFileUri(FileName )) 'second attachment
Dim in As Intent = email.GetIntent
in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION
StartActivity(in)
ProgressDialogHide
End If