Android Question Send Email with Android 10

vecino

Well-Known Member
Licensed User
Longtime User
Hello, some customers are buying new tablets that come with Android V10 and can not send email from my application.
In previous versions of Android works well.
Is there any change in Android V10 in relation to emails?
Thanks.
 

vecino

Well-Known Member
Licensed User
Longtime User
Hello, the case is that it has been working for years with the same code, but with phones and tablets with earlier versions of Android.

B4X:
Sub SendEmail
    Dim mail As Email

    mail.To.Add(cEmail)   
    mail.Subject = "Test " & (DateTime.Date(DateTime.Now))
    mail.Body = "Test"
    mail.Attachments.Add(File.Combine(File.DirDefaultExternal,global.cFileip))

    Dim intMsg As Intent = mail.GetIntent
    intMsg.Flags=1

    StartActivity(intMsg)

End Sub
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Hello, I added permissions to write, although I think it is not necessary in this case, and the error showing now is:
android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/conkex.lagua/files/lagua.zip exposed beyond app through ClipData.Item.getUri()
Before, no error message came out, the application was simply closed.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Hello, this is my code, I copied it from that message precisely. And it has been working a long time, until now. But it only does not work with Android V10
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
I think I'm confusing, I'm going to relax and look at the problem well.
Although the customer I have lent a tablet with Android 6 while I solved the problem that only happens with Android 10.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
while I solved the problem that only happens with Android 10
The solutuion is told in this thread above; use FileProvider! See #5

Everything is explained here (thread is available since 2017).
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Hello, I have already discovered the problem.
The client had not registered any email account in the new tablet of him.
I could not know because he was helping him remotely on the phone.
Finally, when I asked him what email count he was using, he was silent for a moment and then he said. "I think I forgot to register the account."

So there was no problem.
Thanks friends.

 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…