Hi,
I take a Snapshot, then I want to send the picture, error!
android.os.FileUriExposedException: file:///data/user/0/b4a.example.panel8/files/fullimage.jpg exposed beyond app through ClipData.Item.getUri()
...
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Here is the code :
I take a Snapshot, then I want to send the picture, error!
android.os.FileUriExposedException: file:///data/user/0/b4a.example.panel8/files/fullimage.jpg exposed beyond app through ClipData.Item.getUri()
...
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Here is the code :
B4X:
Sub btnSave_Click
Dim x As B4XView = Panel1
Dim b As Bitmap = x.Snapshot
If b.IsInitialized = False Then Return
Dim out As OutputStream
out = File.OpenOutput(File.DirInternal, "fullimage.jpg", False)
b.WriteToStream(out, 100, "JPEG")
out.Close
email_photo
End Sub
Sub email_photo
Dim message As Email
message.To.Add("patrick.imbault@gmail.com")
If File.Exists(File.DirInternal,"fullimage.jpg") Then
message.Attachments.Add(File.Combine(File.DirInternal, "fullimage.jpg"))
End If
message.Subject="photo"
message.Body = "essai de photo"
StartActivity(message.GetIntent)
End Sub