Sub Share
Dim i As Intent
i.Initialize(i.ACTION_SEND, "")
i.SetType("text/html")
i.PutExtra("Intent.EXTRA_EMAIL", "")
i.PutExtra("Intent.EXTRA_SUBJECT", "the subject")
i.PutExtra("Intent.EXTRA_STREAM", "file://" & File.DirInternal & "info.zip")
i.WrapAsIntentChooser("Share Log")
StartActivity(i)
End Sub
Sub Share
Dim i As Intent
i.Initialize(i.ACTION_SEND, "")
i.SetType("text/html")
i.PutExtra("android.intent.extra.EMAIL", "[email protected]")
i.PutExtra("android.intent.extra.SUBJECT", "the subject")
i.PutExtra("android.intent.extra.TEXT", "test")
i.PutExtra("android.intent.extra.STREAM", "file://" & File.DirInternal & "info.zip")
i.WrapAsIntentChooser("Share Log")
StartActivity(i)
End Sub
Sub Share
File.Copy(File.DirInternal,"info.zip",File.DirRootExternal,"info.zip")
Dim i As Intent
i.Initialize(i.ACTION_SEND, "")
i.SetType("text/html")
'i.PutExtra("android.intent.extra.EMAIL", "[email protected]")
i.PutExtra("android.intent.extra.SUBJECT", "the subject")
i.PutExtra("android.intent.extra.TEXT", "test")
i.PutExtra("android.intent.extra.STREAM", CreateUri("file://" & File.Combine(File.DirRootExternal,"info.zip")))
i.WrapAsIntentChooser("Share Log")
StartActivity(i)
End Sub
Sub CreateUri(uri As String) As Object
Dim r As Reflector
Return r.RunStaticMethod("android.net.Uri", "parse", Array As Object(uri), Array As String("java.lang.String"))
End Sub
Dim MyEmail As Email
Sub EmailFile 'email the file to an individual
MyEmail.To.Add(emailaddresshere) 'email address
MyEmail.Subject="This is the file."
MyEmail.Body="Emailing you the file for today: " & DateTime.Date(DateTime.Now)
MyEmail.Attachments.Add(File.Combine(File.DirInternal, "info.zip"))
StartActivity(MyEmail.GetIntent)
End Sub
@Fabio: Here is a way to send an email with an attachment while choosing a mail client:
B4X:Dim MyEmail As Email Sub EmailFile 'email the file to an individual MyEmail.To.Add(emailaddresshere) 'email address MyEmail.Subject="This is the file." MyEmail.Body="Emailing you the file for today: " & DateTime.Date(DateTime.Now) MyEmail.Attachments.Add(File.Combine(File.DirInternal, "info.zip")) StartActivity(MyEmail.GetIntent) End Sub
Dim i As Intent
Dim pm As PackageManager
Dim mensaje, mensaje2, mensajef As String
mensaje= "Comiendo un subway del día de "& Label3.text
mensaje2= "https://graph.facebook.com/Subway/"
mensajef=mensaje &" "& mensaje2
i = pm.GetApplicationIntent("com.twitter.android")
If i.IsInitialized Then
i.Initialize(i.ACTION_SEND, "")
i.SetType("text/plain")
'i.PutExtra("text", mensaje)
i.PutExtra("android.intent.extra.TEXT", mensajef)
StartActivity(i)
Else
ToastMessageShow("Aplicación no esta instalada", False)
End If
---------------------------
But it does not, just open the blank facebook.
and if it is for twitter, facebook becomes open
Twitter-----------------------------
Dim i As Intent
Dim pm As PackageManager
Dim mensaje, mensaje2, mensajef As String
mensaje= "Comiendo un subway del día de "& Label3.text
mensaje2= "https://graph.facebook.com/Subway/"
mensajef=mensaje &" "& mensaje2
i = pm.GetApplicationIntent("com.facebook.katana")
If i.IsInitialized Then
i.Initialize(i.ACTION_SEND, "")
i.SetType("text/plain")
'i.PutExtra("text", mensaje)
i.PutExtra("android.intent.extra.TEXT", mensajef)
StartActivity(i)
Else
ToastMessageShow("Aplicación no esta instalada", False)
End If
Please use [ code ] [ /code ] tags (without spaces) when posting code.
Please also start a new thread for this question.