Android Question Share 2 label.text

Isac

Active Member
Licensed User
Longtime User
What do I want to do?

I would like to share the text of 2 labels by pressing on an image.

I tried this way, but only one label is shared



B4X:
Sub ImageView7_Click
    Dim in As Intent
    in.Initialize(in.ACTION_SEND, "")
    in.PutExtra("android.intent.extra.TEXT", Label3.Text)
    in.PutExtra("android.intent.extra.TEXT", Label4.Text)
    in.SetType("text/plain")
    in.WrapAsIntentChooser("Share Via")
    StartActivity(in)
End Sub
 

ilan

Expert
Licensed User
Longtime User
maybe this is what you are looking for:

B4X:
Sub ImageView7_Click
    Dim str as string = Label3.Text & " " & Label4.Text
    Dim in As Intent
    in.Initialize(in.ACTION_SEND, "")
    in.PutExtra("android.intent.extra.TEXT", str)
    in.SetType("text/plain")
    in.WrapAsIntentChooser("Share Via")
    StartActivity(in)
End Sub
 
Upvote 0

Isac

Active Member
Licensed User
Longtime User
thanks it works

I noticed that with Facebook the text is not captured.
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…