Android Question Mail.GetIntent damaged?

chrjak

Active Member
Licensed User
Longtime User
Hey guys,

When I use Mail.GetIntent some crazy intents like Dropbox or Bluetooth appear. Is this normal? When I open them they cannot handle the mail...

If it's normal: Is there a way to remove single apps from the intent list to remove Dropbox and Bluetooth manually?

Regards
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
When i create a thread WITHOUT any useful informations of what exactly i did and how- And maybe the information what i expected... No Code showing, nothing.

Is this normal that some people give weird answers then?
 
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
When i create a thread WITHOUT any useful informations of what exactly i did and how- And maybe the information what i expected... No Code showing, nothing.

Is this normal that some people give weird answers then?
Is more information required? There is Code showing: "Mail.GetIntent". Probably thats the code where the error is but i will add an Example Send-Mail Code:

Dim Mail as Mail
mail.Body = "Example Body"
Dim list1 As List
list1.Initialize
list1.Add("[email protected]")
list1.Add("[email protected]")
mail.To = list1
mail.Subject = "Example Subject"
StartActivity(mail.GetIntent)
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I guess that you mean As Email instead of As Main.

If you do not need to include attachments then you can use this code:
B4X:
Dim in As Intent
in.Initialize("android.intent.action.SENDTO", "mailto:")
in.PutExtra("android.intent.extra.EMAIL", Array As String("[email protected]"))
in.PutExtra("android.intent.extra.SUBJECT", "this is the subject")
in.PutExtra("android.intent.extra.TEXT", "this is the body")
StartActivity(in)
 
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
Yeah I mean E-Mail instead of Mail

Somehow when I use your code nothing happens... No window, no selection opens and the app is running on
 
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
Ok I tested it and it worked. Now the are only email apps listed but there is another "error"

The App "myMail" doesn't show the "to". the send to field is empty. with the standard function (dim mail as Email) it works...

Is myMail using another intent extra?
 
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
Only the app developers can answer this question.

Try it without the array. Maybe they don't support multiple recipients.
Hi,
I tested it but without array no app works. not MyMail and the other ones neither...

Why can "As Email" make it work but a normal intent not? o.o
 
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
I guess that you mean As Email instead of As Main.

If you do not need to include attachments then you can use this code:
B4X:
Dim in As Intent
in.Initialize("android.intent.action.SENDTO", "mailto:")
in.PutExtra("android.intent.extra.EMAIL", Array As String("[email protected]"))
in.PutExtra("android.intent.extra.SUBJECT", "this is the subject")
in.PutExtra("android.intent.extra.TEXT", "this is the body")
StartActivity(in)
Hey

And what if we need attachments? I googled and found this
intent.putExtra(Intent.EXTRA_STREAM, uri)
but that doesn't work
 
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
you created a new app, writes only this line and then it does not work? Interesting
Regarding above it's just an additionally added line to the regular code. If there is only that one line of course nothing will work
 
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
It's crashing because Cursor doesn't become initialized
 

Attachments

  • Question.zip
    7 KB · Views: 304
Upvote 0
Top