I have an application that integrates Text-To-Speech with WhatsApp. Previously the App could gather text from the user and invoke WhatsApp allowing the user to select an addressee from the WhatsApp address-book using this code.
Now the exception below occurs at the 'StartActivity' line. There are other solutions on the forum initialising the intent using a Java Object but no joy with that either. Is it still possible to invoke WhatsApp to send a plain text message to a selected addressee?
B4X:
Dim i As Intent
i.Initialize(i.ACTION_SEND,"")
i.SetType("text/plain")
i.SetComponent("com.whatsapp/.ContactPicker")
i.PutExtra("android.intent.extra.TEXT",MyText)
StartActivity(i)
Now the exception below occurs at the 'StartActivity' line. There are other solutions on the forum initialising the intent using a Java Object but no joy with that either. Is it still possible to invoke WhatsApp to send a plain text message to a selected addressee?
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (main) Resume **
Error occurred on line: 122 (Main)
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.whatsapp/com.whatsapp.ContactPicker}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2098)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1747)
at android.app.Activity.startActivityForResult(Activity.java:5465)
at android.app.Activity.startActivityForResult(Activity.java:5423)
at android.app.Activity.startActivity(Activity.java:5809)
at android.app.Activity.startActivity(Activity.java:5762)
at anywheresoftware.b4a.keywords.Common.StartActivity(Common.java:857)
at com.waterline.whatsappdictate.main._btnwhatsapp_click(main.java:544)
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:348)
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)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (main) Resume **
Error occurred on line: 122 (Main)
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.whatsapp/com.whatsapp.ContactPicker}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2098)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1747)
at android.app.Activity.startActivityForResult(Activity.java:5465)
at android.app.Activity.startActivityForResult(Activity.java:5423)
at android.app.Activity.startActivity(Activity.java:5809)
at android.app.Activity.startActivity(Activity.java:5762)
at anywheresoftware.b4a.keywords.Common.StartActivity(Common.java:857)
at com.waterline.whatsappdictate.main._btnwhatsapp_click(main.java:544)
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:348)
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)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
Last edited: