This is the code I use to share some text via email:
Code I use to share text via email:
Public Sub shareAppByEmail(subject As String, body As String)
Dim in As Intent
'Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:" + email));
in.Initialize(in.ACTION_SEND, "")
in.putExtra("android.intent.extra.SUBJECT", subject)
in.PutExtra("android.intent.extra.TEXT", body)
in.SetType("text/plain")
in.WrapAsIntentChooser("Share Via")
StartActivity(in)
End Sub
When the code is executed, above screen appears; as you can see, a lot of apps are shown. What can I do so that only email apps (Gmail and Email) show up?
Dim in As Intent
in.Initialize("android.intent.action.SENDTO", "mailto:")
in.PutExtra("android.intent.extra.EMAIL", Array As String("email@example.com"))
in.PutExtra("android.intent.extra.SUBJECT", "this is the subject")
in.PutExtra("android.intent.extra.TEXT", "this is the body")
StartActivity(in)
Dim in As Intent
in.Initialize("android.intent.action.SENDTO", "mailto:")
in.PutExtra("android.intent.extra.EMAIL", Array As String("email@example.com"))
in.PutExtra("android.intent.extra.SUBJECT", "this is the subject")
in.PutExtra("android.intent.extra.TEXT", "this is the body")
StartActivity(in)
Dim in As Intent
in.Initialize("android.intent.action.SENDTO", "mailto:")
in.PutExtra("android.intent.extra.EMAIL", Array As String("email@example.com"))
in.PutExtra("android.intent.extra.SUBJECT", "this is the subject")
in.PutExtra("android.intent.extra.TEXT", "this is the body")
StartActivity(in)