Hi all,
I am now back to looking at this as my app is very nearly complete. I have two versions of code that work for different email apps.
The first 'Generic' version uses the B4A supplied Email object but my HTC mail doesn't appear as an option in the chooser. This works and allows attachment of email to both K-9 mail and GMail, although the Gmail doesn't send (that's another issue though and nothing to do with B4A)
The second 'HTC' List's K-9, Gmail and the HTC mail app, The Htc mail app works and attaches the file and sends, the K-9 mail doesn't attach the file and Gmail stops responding!.
My question is, how does using the Email Object differ to creating an intent from scratch (as in version 2), as both are halfway there and I'd like to meet in the middle and get one routine to work with all email apps.
Thanks
Steve
'Generic
Dim Email1 As Email
Email1.Subject="file.zip"
Email1.Attachments.Add(File.Combine(File.Combine(File.DirRootExternal,"cpbackups"),"file.zip"))
Try
StartActivity(Email1.GetIntent)
Catch
Log("CreateMail: Start Activity Failed... ")
End Try
'HTC
Dim Intent1 As Intent
Uri="file://"&File.Combine(File.Combine(File.DirRootExternal,"cpbackups"),"file.zip")
Intent1.Initialize(Intent1.ACTION_SEND,"")
Intent1.PutExtra("android.intent.extra.SUBJECT","file.zip")
Intent1.PutExtra("android.intent.extra.STREAM",Uri)
Intent1.SetType("application/zip")
Intent1.PutExtra("android.intent.extra.TEXT","Message Text")
Try
StartActivity(Intent1)
Catch
Log("CreateMail: Start Activity Failed... "&Uri)
End Try
I am now back to looking at this as my app is very nearly complete. I have two versions of code that work for different email apps.
The first 'Generic' version uses the B4A supplied Email object but my HTC mail doesn't appear as an option in the chooser. This works and allows attachment of email to both K-9 mail and GMail, although the Gmail doesn't send (that's another issue though and nothing to do with B4A)
The second 'HTC' List's K-9, Gmail and the HTC mail app, The Htc mail app works and attaches the file and sends, the K-9 mail doesn't attach the file and Gmail stops responding!.
My question is, how does using the Email Object differ to creating an intent from scratch (as in version 2), as both are halfway there and I'd like to meet in the middle and get one routine to work with all email apps.
Thanks
Steve
'Generic
Dim Email1 As Email
Email1.Subject="file.zip"
Email1.Attachments.Add(File.Combine(File.Combine(File.DirRootExternal,"cpbackups"),"file.zip"))
Try
StartActivity(Email1.GetIntent)
Catch
Log("CreateMail: Start Activity Failed... ")
End Try
'HTC
Dim Intent1 As Intent
Uri="file://"&File.Combine(File.Combine(File.DirRootExternal,"cpbackups"),"file.zip")
Intent1.Initialize(Intent1.ACTION_SEND,"")
Intent1.PutExtra("android.intent.extra.SUBJECT","file.zip")
Intent1.PutExtra("android.intent.extra.STREAM",Uri)
Intent1.SetType("application/zip")
Intent1.PutExtra("android.intent.extra.TEXT","Message Text")
Try
StartActivity(Intent1)
Catch
Log("CreateMail: Start Activity Failed... "&Uri)
End Try
Last edited: