The following codes work when I want to send files via email but the DirRootExternal path appears in the To: field. Is there a way to prevent that?
B4X:
Dim In As Intent
Dim u As Uri 'ContentResolver library
In.Initialize(In.ACTION_SEND,"file://" & File.Combine(File.DirRootExternal, "test.txt"))
u.Parse("file://" & File.Combine(File.DirRootExternal, "test.txt"))
In.PutExtra("android.intent.extra.STREAM", u)
In.SetType("*/*")
StartActivity(In)
Thanks and the path still appears in the To: field with someone@abc.com
B4X:
Dim In As Intent
Dim u As Uri 'ContentResolver library
In.Initialize(In.ACTION_SEND,"file://" & File.Combine(File.DirRootExternal, "test.txt"))
u.Parse("file://" & File.Combine(File.DirRootExternal, "test.txt"))
In.PutExtra("android.intent.extra.STREAM", u)
In.PutExtra("android.intent.extra.EMAIL", ArrayAsString("someone@abc.com"))
In.SetType("*/*")
StartActivity(In)
If the following is commented out there was no attachment
Dim In As Intent
Dim u As Uri 'ContentResolver library
In.Initialize(In.ACTION_SEND,"file://" & File.Combine(File.DirRootExternal, "test.txt"))
u.Parse("file://" & File.Combine(File.DirRootExternal, "test.txt"))
In.PutExtra("android.intent.extra.STREAM", u)
In.PutExtra("android.intent.extra.EMAIL", ArrayAsString("someone@abc.com")) '<<======== from
In.SetType("*/*")
StartActivity(In)
to
B4X:
Dim In As Intent
Dim u As Uri 'ContentResolver library
In.Initialize(In.ACTION_SEND,"file://" & File.Combine(File.DirRootExternal, "test.txt"))
u.Parse("file://" & File.Combine(File.DirRootExternal, "test.txt"))
In.PutExtra("android.intent.extra.STREAM", u)
In.PutExtra("android.intent.extra.EMAIL", ArrayAsString("")) '<<======== to
In.SetType("*/*")
StartActivity(In)
If that was what you meant, the path still appears in the To: field which I wanted to remove.