My first page showing is other than MainPage, But at some point, I would like to show MainPage....
The problem lies exactly here : While the close method takes an object as argument, the show method takes a String, and I can't figure out what the ID is.
I have stried strings like "mainpage" ; "MainPage" ; "B4XMainPage" and a few others, but nothing seems to work.
Thanks, You sent me in the right direction.... I had searched for some sort of getId, but ihad somehow eluded me.
I also found that you need to first call B4XPages.show to show the page you want to show, before closing the current page.
In my particular case, I'm thinking of showing a few "secondary" pages before showing MainPage (where all good stuff will happen), so I prefer the "Show before close" logic that allows me to do it all from MainPage instead of managing each page close request
Obviously I don't know your project, but why don't you create a class which does all those "good stuff" and whose instance you can create wherever you want, in the B4XMainPage or elsewhere?
For completeness, I should correct my post #8, "queues" are First In First Out (FIFO) structures.
B4XPages are in a "stack" which is Last In First Out (LIFO).
My first page showing is other than MainPage, But at some point, I would like to show MainPage....
The problem lies exactly here : While the close method takes an object as argument, the show method takes a String, and I can't figure out what the ID is.
I have stried strings like "mainpage" ; "MainPage" ; "B4XMainPage" and a few others, but nothing seems to work.