This is the code I use to share a zip file as an email attachment
StartActivity opens a share dialog with all kind of apps: Gmail, Facebook, Drive, Outlook, Chrome... and is up to the user to select the correct one.
Is there a way to limit the list of app the OS shows?
Ideally I'd limit the list to email apps (primarily Gmail) and also Drive (because if the zip attachment is too big, the user may share it via Drive)
B4X:
Dim email As Email
email.To.Add(m_EmailAddress)
email.Subject = Subject
email.Body = Body
'copy the file to the shared folder
File.Copy(Starter.privateDir, FileName, Starter.Provider.SharedFolder, FileName)
email.Attachments.Add(Starter.Provider.GetFileUri(FileName))
Dim in As Intent = email.GetIntent
in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION
StartActivity(in)
StartActivity opens a share dialog with all kind of apps: Gmail, Facebook, Drive, Outlook, Chrome... and is up to the user to select the correct one.
Is there a way to limit the list of app the OS shows?
Ideally I'd limit the list to email apps (primarily Gmail) and also Drive (because if the zip attachment is too big, the user may share it via Drive)