Android Question Intent to send a text (sms) to messenger's tel number

peacemaker

Expert
Licensed User
Longtime User
HI, All

Sharing code via "smsto" is known. But is there any solution to pre-setup the phone number contact ?
Googling cannot help, and very old postings...
For Viber, at least.

Or is it now impossible for sure ? to send to the selected phone number.
 

peacemaker

Expert
Licensed User
Longtime User
No, you did not understand correctly. Subject is about apps-messengers, Viber, Skype.... to open it with the pre-installed contact.
Many samples of code that worked in 2014, 2015, but not now, 2017.

Seems, no possibility to make it now, cannot find...
 
Last edited:
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
SOLVEEEEEED !


B4X:
Sub Send_Viber(tel As String)
    Dim i As Intent
    i.Initialize(i.ACTION_VIEW, "tel:" & tel)  ' MAIN THING !
    Dim jo As JavaObject = i
    jo.RunMethod("setPackage", Array("com.viber.voip"))
    i.WrapAsIntentChooser("Viber:")
    StartActivity(i)
End Sub
 
Upvote 0
Top