Android Question B4XPages-Add a Page Create it and Show it

Mahares

Expert
Licensed User
Longtime User
I can do this to add, create and show a new page.:
B4X:
B4XPages.AddPageAndCreate("MyDisplayedPage", MyDisplayedPage)
B4XPages.ShowPage("MyDisplayedPage")
Why isn't there a method that can do all three at once in one line like this:
B4XPages.AddPageAndCreateAndShow("MyDisplayedPage", MyDisplayedPage)
 

Mahares

Expert
Licensed User
Longtime User
ShowPage creates the page when needed.
I think I am confusing the word 'Create' in B4Xpages with the word 'Create' in Create a table in SQLite'. In B4XPages, you add before you create and in SQLite you create before you add.. Is that a correct assessment. I always felt the proper logic is to CREATE before you ADD
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Add - Tell B4XPages that there is a page with the given id.
Create - The page is created. B4XPage_Created event will be raised.

In most cases you don't need to worry about the creation step. It happens automatically when the page is first shown. AddPageAndCreate is useful when you want to access the page interface before the page is shown.
 
Upvote 0
Top