B4J Question [B4Pages]What is the best way to determine if a given page id exists?

William Lancee

Well-Known Member
Licensed User
Longtime User
I've tried a variety of ways, none elegant, and a Try block is the ugliest of all.
Note that a page can exist without being on the stack.
 

William Lancee

Well-Known Member
Licensed User
Longtime User
For now, I'll keep my own global B4XSet with page ids in B4XMainPage, and check with .Contains.
There is such a set in B4XPageManger, but it is not Public.
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
In this project, the pages are created based on various decisions the user makes. Moreover, the initialization of the page is quite involved.
So at first I thought that I would not initialize the page instance until needed. Hence my question.

However, your answer made me take an hour and move the dynamic parts out of initialization and into create. It works very well.
Thank you.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…