Thanks Erel,
No I am not able to send plain text also.
Dim sendIntent As Intent
sendIntent.Initialize(sendIntent.ACTION_MAIN,"")
sendIntent.Action=sendIntent.ACTION_SEND
sendIntent.SetPackage("com.whatsapp")
sendIntent.putExtra("jid", number & "@s.whatsapp.net")
sendIntent.PutExtra("android.intent.extra.TEXT","Trial Msg")
sendIntent.SetType("text/plain")
StartActivity(sendIntent)
Shows error as below-:
Error occurred on line: 59 (frmWASender)
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND typ=text/plain flg=0x20001 pkg=com.whatsapp clip={text/plain T:Trial Msg} (has extras) }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2071)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1717)
at android.app.Activity.startActivityForResult(Activity.java:5250)
at android.app.Activity.startActivityForResult(Activity.java:5208)
at android.app.Activity.startActivity(Activity.java:5579)
at android.app.Activity.startActivity(Activity.java:5547)
at anywheresoftware.b4a.keywords.Common.StartActivity(Common.java:857)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at com.CustomerLoyalty.frmwasender._sendpdf(frmwasender.java:425)
at com.CustomerLoyalty.frmwasender._btnsendpdf_click(frmwasender.java:417)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
I checked in forum the set component is used everywhere like that only.
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_SEND, $"https://api.whatsapp.com/send?phone=${"91123456789"}&text=${"Hello"}"$)
StartActivity(Intent1)
This code opens Whatsapp with msg. Just checked I don't need this.