I have two applications: App1 and App2.
App1 has an Activity named SearchLocation.
I added in Manifest.xml of App1:
Now I use the following code in App2:
But cannot open App1's SearchLocation Activity,
The error log is as follows:
How to open my App1's Activity from App2?
Thank!
App1 has an Activity named SearchLocation.
I added in Manifest.xml of App1:
B4X:
AddActivityText(SearchLocation,
<activity android:name="tw.edu.kyu.md.app.tainanpark2a.SearchLocation" ></activity>
)
Now I use the following code in App2:
B4X:
Sub Button1_Click
Dim i As Intent
i.Initialize("", "")
i.SetComponent("tw.edu.kyu.md.app.tainanpark2a/.Searchlocation")
Try
StartActivity(i)
Catch
ToastMessageShow("app intent not found.", True)
End Try
End Sub
But cannot open App1's SearchLocation Activity,
The error log is as follows:
B4X:
Error occurred on line: 46 (Main)
android.content.ActivityNotFoundException: Unable to find explicit activity class {tw.edu.kyu.md.app.tainanpark2a/tw.edu.kyu.md.app.tainanpark2a.SearchLocation}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1855)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1546)
at android.app.Activity.startActivityForResult(Activity.java:4284)
at android.app.Activity.startActivityForResult(Activity.java:4231)
at android.app.Activity.startActivity(Activity.java:4568)
at android.app.Activity.startActivity(Activity.java:4536)
at anywheresoftware.b4a.keywords.Common.StartActivity(Common.java:848)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:755)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:345)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5698)
at android.widget.TextView.performClick(TextView.java:10846)
at android.view.View$PerformClick.run(View.java:22557)
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:7231)
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)
How to open my App1's Activity from App2?
Thank!
Last edited: