Email - show only email progs

canalrun

Well-Known Member
Licensed User
Longtime User
Hello,
The following question was asked a couple months ago, but does not seem to have been answered. I am running into the same issue. Is it possible to limit the choices within the "Complete Action Using…" dialog that pops up to only e-mail programs?

-------------

B4X:
Dim Message As Email
Message.To.Add("SomeEmail@example.com")
Message.Attachments.Add(File.Combine(File.DirRootE xternal, "SomeFile.txt"))
StartActivity(Message.GetIntent)
This works perfectly. However, the line "StartActivity" launches a "Complete action using..." activity. I expected this to happen, as I have more than one email app installed that can deal with the intent. However, the list of apps I am presented with includes...

Bluetooth
Copy to Clipboard
Google Drive
Facebook
Google
Google+
LinkedIn
Messaging
WiFi Direct

... why would all these other apps appear? I would not have thought "Bluetooth" would cope with the email intent (in fact it does not, if I select it I get an error "Unable to open file for sharing"). If I select an email app the intent works perfectly.

Is there any way to prevent all these other apps from displaying?

-------------

Thanks,
Barry.
 

canalrun

Well-Known Member
Licensed User
Longtime User
Try this code:

Thanks. Works great!

I am using it in conjunction with the Email object:

B4X:
Dim msg As Email
Dim nt As Intent
      
msg.Body = ...
msg.Subject = ...
msg.Attachments.Add(...)

nt = msg.GetIntent
nt.SetType("message/rfc822")
     
StartActivity(nt)

Barry.
 
Upvote 0
Top