LucaMs Expert Licensed User Longtime User Sep 25, 2020 #1 This is meant to be a suggestion, almost a trick; I don't know where I should write it. The method to obtain a reference to a B4XPage is: B4X: Copy Dim Page As clsMyPage = B4XPages.GetPage("PageId") As you can see in the ThreePagesExample project, the two "extra" pages, Page2 and Page3, are declared as Global Public, initialized and added to B4XPages in the B4XMainPage. By doing this, you will be able to access each page much more easily by writing: B4X: Copy B4XPages.MainPage.Page2 without the need to create a new variable (Dim Page, above), without having to remember the page Id string, avoiding to use literals and without the risk of writing it wrong. Using the first method, however, it will be possible to use a variable as page identifier, which in some cases could be useful/necessary. [I know, this may seem to be very obvious but not for everyone] Last edited: Sep 25, 2020
This is meant to be a suggestion, almost a trick; I don't know where I should write it. The method to obtain a reference to a B4XPage is: B4X: Copy Dim Page As clsMyPage = B4XPages.GetPage("PageId") As you can see in the ThreePagesExample project, the two "extra" pages, Page2 and Page3, are declared as Global Public, initialized and added to B4XPages in the B4XMainPage. By doing this, you will be able to access each page much more easily by writing: B4X: Copy B4XPages.MainPage.Page2 without the need to create a new variable (Dim Page, above), without having to remember the page Id string, avoiding to use literals and without the risk of writing it wrong. Using the first method, however, it will be possible to use a variable as page identifier, which in some cases could be useful/necessary. [I know, this may seem to be very obvious but not for everyone]
AnandGupta Expert Licensed User Longtime User Sep 25, 2020 #2 LucaMs said: This is meant to be a suggestion, almost a trick; I don't know where I should write it. Click to expand... Better write in Android tutorial. Now, Erel may move it there. Regards Anand Upvote 0
LucaMs said: This is meant to be a suggestion, almost a trick; I don't know where I should write it. Click to expand... Better write in Android tutorial. Now, Erel may move it there. Regards Anand