Android Question Whatsapp send message charachter problem

tufanv

Expert
Licensed User
Longtime User
Hello,

Using the below code to send a message to a whatspp contact:

B4X:
    Dim i As Intent
 
    i.Initialize(i.ACTION_VIEW, $"https://api.whatsapp.com/send?text=Test%%)
    i.SetComponent("android/com.android.internal.app.ResolverActivity")
  
    Try
        StartActivity(i)
    Catch
        Log("whatsapp yok")
    End Try

The percentage sign shows as question mark which means not recognized by whatsapp. Everything works perfect other than this. What may be the problem?

Thanks
 

Lello1964

Well-Known Member
Licensed User
Longtime User
i use this to send pdf


B4X:
    Dim sendIntent As Intent
    sendIntent.Initialize(sendIntent.ACTION_MAIN,"")
    sendIntent.Action=sendIntent.ACTION_SEND
    sendIntent.SetPackage("com.whatsapp")
    sendIntent.SetComponent("android/com.android.internal.app.ResolverActivity")
    ''sendIntent.SetComponent("com.whatsapp/.ContactPicker")
    sendIntent.PutExtra("android.intent.extra.STREAM", Starter.Provider.GetFileUri("documento.pdf"))
    sendIntent.PutExtra("android.intent.extra.TEXT","Si allega documento :")
    sendIntent.SetType("application/pdf")
    StartActivity(sendIntent)
 
Upvote 0
Top