Good morning,
can someone help me to solve my problem?
In B4A I used StartActivity() to link two different App, but in B4i there isn't StartActivity().
What method or instruction should I use to merge the two apps?
Thanks a lot
Vincenzo
The question is how to start a second app. The answer is:
Target app:
Add to main module:
B4X:
#UrlScheme: b4i.example2
Source app:
B4X:
#QueriesSchemes: b4i.example2
Private Sub Button1_Click
If Main.App.CanOpenURL("b4i.example2://") Then
Main.App.OpenURL("b4i.example2://")
End If
End Sub
I'm trying but no results.
I used the package ID instead of the module name, leaving the two apps separate, as suggested but nothing.
I am not an expert.
I don't use the Main function, it must be declared, how?
Help me
Thanks
B4A v3.80 adds support for conditional compilation. From Wikipedia: In computer programming, conditional compilation is compilation implementing methods which allow the compiler to produce differences in the executable produced controlled by parameters that are provided during compilation...
#if Calling
#ApplicationLabel: Calling another Example App
#else if callee
#ApplicationLabel: Called example App
#End If
B4X:
#if calling
#QueriesSchemes: uk.co.digitwell.app2
#Else if callee
#UrlScheme: uk.co.digitwell.app2
#end if
B4X:
private Sub b4xpage_appear
#if calling
xui.MsgboxAsync("Click on the button to start the second app","")
#else if callee
xui.MsgboxAsync("I am the second app.","")
#End If
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
#if calling
If Main.App.CanOpenURL("uk.co.digitwell.app2://") Then
Main.App.OpenURL("uk.co.digitwell.app2://")
End If
#else if callee
xui.MsgboxAsync("Start the other app","")
#end if
End Sub