Android Question Go to special page without page object

darabon

Active Member
I have many pages in my project.
I want go to a special page with an id without understanding the page object
For example, login page (pagelogin ID) or profile page (pageProfile ID)
For adding a page, We have to use B4XPages.AddPage("profile",pgProfile_)
pgProfile_ is Private pgProfile_ As pgAccount
But because my pages are very many, I cannot declare for each page
How can I go to the page now?
 

Lucas Siqueira

Active Member
Licensed User
Longtime User

Declare all your pages as Public in Sub Class_Globals in the B4XMainPage module.


This way you will be able to access functions that exist within the page.

when I want to open a page and pass a value to the page.
B4X:
    B4XPages.ShowPage("PageData")
    B4XPages.MainPage.PageData.loadData("2")


this way, you open the page
and pass the parameter you want.


 
Upvote 0

darabon

Active Member
If I declare pages on first time, maybe the app be slowly
 
Upvote 0

darabon

Active Member
Calling B4XPage.AddPage many times will not have any effect on the performance. The pages are only really created when the page is first shows or if you call B4XPage.AddPageAndCreate.
That is good if does not affect on performance
Thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…