Android Question Share text

RUNO

Active Member
Licensed User
Longtime User
I would like to share a text (a message), not a file with social apps.
I have used some code from the forum but it didn't work.
Can any one help me?
B4X:
Dim msgstr As String = "my msg"
    Dim int1 As Intent
    int1.Initialize(int1.ACTION_SEND, "")
    int1.putExtra("android.intent.extra.TEXT",msgstr)
    int1.SetType("message/rfc822")
    int1.WrapAsIntentChooser("Select") 'will show always ContentChooser
    StartActivity(int1)
 

asales

Expert
Licensed User
Longtime User
B4X:
    Dim i As Intent
    i.Initialize(i.ACTION_SEND, "")
    i.SetType("text/plain")
    i.PutExtra("android.intent.extra.TEXT", "This is the text")
    i.WrapAsIntentChooser("Select")
    StartActivity(i)
 
Upvote 0
Top