B4J Question Add New Page

AndroidMadhu

Active Member
Licensed User
Hi,
I have added a new Page as below :


Now I want to declare the page like below

B4X:
Private Page2 As B4XPage2
Page2 = B4XPages.GetPage("Page 2")

Where to declare these lines? Is it at B4XMainPage or Main

Thanks
 

udg

Expert
Licensed User
Longtime User
B4xMainPage. You need to initialize and add the page to the page manager too
B4X:
Dim aPage As pgPage2
aPage.Initialize
B4XPages.AddPageAndCreate("Page2", aPage)
 
Upvote 1

udg

Expert
Licensed User
Longtime User
I'm glad you solved your problem.
Thank you for the "like" at my post. Generally, we use to modify the title adding an initial "[solved]" indication to make it easier for others to find threads with a solution.
Recently @Erel added the option to vote a post as a solution; this too is an indication for others to watch there for a working solution.

Personally, I find that a simple "thank you" is more than enough (afterall this is a community where we help each other just because we like to do it), but I understand that adhering to the forum practices makes it simpler for others, so why not?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…