B4XPages is a library that serves two purposes: 1. Make it simple to develop B4A apps by solving almost all of the challenges involved with Android complex activities life cycle. B4XPages makes B4A behave more similar to B4J and B4i where the new "B4XPage" element is a regular object that is...
b4x.com
There are codes on B4XMainPage
B4X:
Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Public txtUser As B4XFloatTextField
Private btnLogin As B4XView
Public Page2 As B4XPage2
Public Page3 As B4XPage3
End Sub
Variables Page2 & Page3, why they are need to be public?
I think public or private doesn't matter in this case, cause with the new method B4XPages.GetPage(Id), Page2/Page3 can be accessed from any sub or class. RIght?
No. B4XPages are regular classes. You can access them however you like.
There is no reason not to provide B4XPages.GetPage method as it can be convenient. If you don't need it then don't use it.
Who said that we want to add the pages variables to the main page at all? There are many ways that the pages can be created.
Maybe we want to access 'page 9' from 'page 8'. Why should page 9 be declared in main page for this? Better design to get page 9 using GetPage.