Hi Experts,
In B4A I could raise an event sub in the Main Activity from a Class Module by passing the Main Activity to my Class Module when I initialized it like so:
Then in the Main Activity I had:
I could then raise the 'SomeEvent' sub in the Main Activity from the Class Module like so (I made the 'Main' variable = Activity):
But when I try to do something similar in B4i using the PageRoot (instead of Activity) I get an 'Invalid Component' error, in other word it does not like the fact that I am trying to use PageRoot instead of Activity. How do I do this in B4i?
Thank you very much for your time,
Regards
Jacques.
In B4A I could raise an event sub in the Main Activity from a Class Module by passing the Main Activity to my Class Module when I initialized it like so:
B4X:
MyModule.Initialize(Activity,"MyModule")
Then in the Main Activity I had:
B4X:
Sub MyModule_SomeEvent(SomeParameter as string)
'...do something
End Sub
I could then raise the 'SomeEvent' sub in the Main Activity from the Class Module like so (I made the 'Main' variable = Activity):
B4X:
If SubExists(Main, "MyModule_SomeEvent") = True Then
CallSub2(Main, "MyModule_SomeEvent", SomeParameter)
End If
But when I try to do something similar in B4i using the PageRoot (instead of Activity) I get an 'Invalid Component' error, in other word it does not like the fact that I am trying to use PageRoot instead of Activity. How do I do this in B4i?
Thank you very much for your time,
Regards
Jacques.