I'm observing this strange behavior
In B4XMainPage B4XPage_Created sub the following call crashes the app
B4X:
CallSub(B4XPages.MainPage, "State_Update")
while this one works
B4X:
CallSub(Me, "State_Update")
I know that I can call the sub directly, but this is just the demo of the real use case: a callback from a class, back to main page, which is failing and I reproduced the issue in this minimal way
Maybe you are calling it before B4XPage.MainPage is set. Why do you need this strange code?
Just call the sub directly. If you encounter a real issue then please upload a project that demonstrates it.
This just a proof of concept for a more convoluted code, where i need a callback to the main page.
it’s called in the B4XPage_Created sub, so I think the object already exists
also, it works fine in B4A, while it crashes is B4i
i solved the issue using Me, but I’ll investigate it later