When I use Erel code:
Sub ShareWithIntent(msg AsString)
Dim in As Intent
in.Initialize(in.ACTION_SEND, "")
Dim jo As JavaObject = in
jo.RunMethod("setPackage", Array("org.telegram.messanger"))
in.PutExtra("android.intent.extra.TEXT", msg)
in.SetType("text/plain")
StartActivity(in)
End Sub
I got this error. Please see below log data.
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
> Read Parameters
** Activity (main) Resume **
Error occurred on line: 1064 (Main)
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND typ=text/plain flg=0x20001 pkg=org.telegram.messanger VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} clip={text/plain T:Test send text to Telegram} (has extras) }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1878)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1545)
at android.app.Activity.startActivityForResult(Activity.java:4283)
at android.app.Activity.startActivityForResult(Activity.java:4230)
at android.app.Activity.startActivity(Activity.java:4567)
at android.app.Activity.startActivity(Activity.java:4535)
at anywheresoftware.b4a.keywords.Common.StartActivity(Common.java:698)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:747)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:5697)
at android.widget.TextView.performClick(TextView.java:10814)
at android.view.View$PerformClick.run(View.java:22526)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)